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

Stats:

CreatedDec 21, 2017
PublishedDec 22, 2017
Warriors Trained2382
Total Skips90
Total Code Submissions5445
Total Times Completed484
JavaScript Completions223
Python Completions215
Ruby Completions41
Haskell Completions28
Rust Completions10
Total Stars111
% of votes with a positive feedback rating94% of 149
Total "Very Satisfied" Votes134
Total "Somewhat Satisfied" Votes13
Total "Not Satisfied" Votes2
Total Rank Assessments9
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • KenKamau Avatar
  • myjinxin2015 Avatar
  • Voile Avatar
  • Awesome A.D. Avatar
  • user8436785 Avatar
Ad