5 kyu
Simple parenthesis removal
224 of 485KenKamau
Description:
In this Kata, you will be given a expression string and your task will be to remove all braces as follows:
solve("x-(y+z)") = "x-y-z"
solve("x-(y-z)") = "x-y+z"
solve("u-(v-w-(x+y))-z") = "u-v+w+x+y-z"
solve("x-(-y-z)") = "x+y+z"
There are no spaces in the expression. Only two operators are given: "+" or "-"
.
More examples in test cases.
Good luck!
Strings
Logic
Algorithms
Similar Kata:
Stats:
Created | Dec 21, 2017 |
Published | Dec 22, 2017 |
Warriors Trained | 2381 |
Total Skips | 90 |
Total Code Submissions | 5450 |
Total Times Completed | 485 |
JavaScript Completions | 224 |
Python Completions | 216 |
Ruby Completions | 42 |
Haskell Completions | 29 |
Rust Completions | 11 |
Total Stars | 111 |
% of votes with a positive feedback rating | 94% of 149 |
Total "Very Satisfied" Votes | 134 |
Total "Somewhat Satisfied" Votes | 13 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 9 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |