Given a Binary String S (string that contains only 0's and 1's). Find minimum number of palindromic subsequences that are needed to be removed such that string S becomes empty.
The first line of the input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. The first line of each test case consists of an integer N denoting the size of the string S. The second line of each test case consists of a binary string S.
For each test case print in a new line the number of palindromic subsequences to be removed.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.