Problem 43320. Expand a term
Given a term, as a string, expand it.
e. g.
f = '2(x + y)';
Solution Stats
Problem Comments
-
2 Comments
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.
Solution Comments
Show commentsProblem Recent Solvers36
Suggested Problems
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1939 Solvers
-
Check if number exists in vector
13314 Solvers
-
Calculate distance travelled when given radius and rotations
233 Solvers
-
Area of an equilateral triangle
6651 Solvers
-
Write a code that will follow the equation y = x * (x + x) * x.
351 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!