5 kyu
Simple string expansion
647 of 1,977KenKamau
Description:
Consider the following expansion:
solve("3(ab)") = "ababab" -- because "ab" repeats 3 times
solve("2(a3(b))") = "abbbabbb" -- because "a3(b)" == "abbb", which repeats twice.
Given a string, return the expansion of that string.
Input will consist of only lowercase letters and numbers (1 to 9) in valid parenthesis. There will be no letters or numbers after the last closing parenthesis.
More examples in test cases.
Good luck!
Please also try Simple time difference
Algorithms
Similar Kata:
Stats:
Created | Feb 6, 2018 |
Published | Feb 6, 2018 |
Warriors Trained | 6041 |
Total Skips | 765 |
Total Code Submissions | 9146 |
Total Times Completed | 1977 |
JavaScript Completions | 647 |
Python Completions | 817 |
Ruby Completions | 122 |
Haskell Completions | 83 |
C++ Completions | 175 |
Java Completions | 188 |
Clojure Completions | 6 |
Total Stars | 162 |
% of votes with a positive feedback rating | 95% of 389 |
Total "Very Satisfied" Votes | 355 |
Total "Somewhat Satisfied" Votes | 29 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 5 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |