5 kyu
Simple parenthesis removal
215 of 484KenKamau
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 | 2382 |
Total Skips | 90 |
Total Code Submissions | 5445 |
Total Times Completed | 484 |
JavaScript Completions | 223 |
Python Completions | 215 |
Ruby Completions | 41 |
Haskell Completions | 28 |
Rust Completions | 10 |
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 |