balanced string equal quantity l R charactersgiven balanced string s split number substring thateach substre balancedreturn maximum number balance string obtain Example 1input s RLRRLLRLRLOutput 4explanation s split RL RRLL RL RL substring contain number L RExample 2input s rlrrrllrlloutput 2explanation s split RL RRRLLRLL substring contain number L RNote s split RL rr RL LR LL 2nd 5th substring balancedExample 3input s LLLLRRRROutput 1explanation s split LLLLRRRR constraints2 slength 1000si L Rs balanced string