Recently gave online assessment for Amazon.
Here is the question I remember:
Given a String S return the number of ways you could split the string into balanced strings. ? could be replaced with ( or ) or [ or ].
So for example let say S = [(?]]??[ split the string into [(?] and ]??[ .
So the answer should return 2.
public int balancedString(String s){
}I was able to pass 5 test cases.