Rahul is a geek. Head is the lucky call for him. You have to make him lucky. You are provided N coins. If the coin is heads facing upwards it means he is lucky else unlucky, your task is to do an operation to make him lucky. Operation allowed is as follows :
Starting from first element, if you find any coin heads facing downwards (Tail), flip the coin at ith index and (i+1)th index.
The first line consists of T test cases. Each test case consists of 2 lines. The first line contains an integer N, denoting the number of coins. The second line contains N coins, represented by H or T (denoting head facing upwards and tail facing upwards respectively).
For each test case, output two lines where first line should contain number of flips, while next line contains indexes where coins have been flipped (starting index from 1). If no coin is flipped, second line prints "-1" (without quotes).
1 <= T <= 103
1 <= N <= 107
H H H
H T H T H
Testcase2: Coins at index 2 and 3 needs to be flipped to make Rahul happy.
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.