Can you tell me what is wrong in this coding of question:https://www.codechef.com/problems/CHEFSQ

You are comparing each element of subarray with ‘g’ itself. Just increment the index of orignal array. And also make ‘count=0’ at the begining of the second ‘for’ loop

1 Like

You can refer to this: https://www.codechef.com/viewsolution/24290928