Given a term, as a string, expand it.
e. g.
f = '2(x + y)';
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers36
Suggested Problems
-
Sum of diagonal of a square matrix
1640 Solvers
-
Return unique values without sorting
1013 Solvers
-
MATCH THE STRINGS (2 CHAR) very easy
301 Solvers
-
07 - Common functions and indexing 1
454 Solvers
-
Let's get back to school, and create multiplication tables
241 Solvers
More from this Author14
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Nice idea, but the test cases are a bit confusing. Why do you add one space before and after '(', but none after ')' and three between the letters and the '+' symbol?
Thanks for the input :)
The reason I add one before '(' is because there is a '2' before it, which is part of the term. The ones between the letters and the '+' symbol are because spaces are characters, too.