Balanced String

Programming/Algorithm

[Java-알고리즘] Split a String in Balanced Strings

[Problem] Balanced strings are those who have equal quantity of 'L' and 'R' characters. Given a balanced string s split it in the maximum amount of balanced strings. Return the maximum amount of splitted balanced strings. [Example1] Input: s = "RLRRLLRLRL" Output: 4 Explanation: s can be split into "RL", "RRLL", "RL", "RL", each substring contains same number of 'L' and 'R'. [Example2] Input: s ..

JohnMark
'Balanced String' 태그의 글 목록