Is this approach correct
Or Do I have to do like this
For each I, I will have to check for each j or
We can check for consecutive only.
Is this approach correct
Or Do I have to do like this
For each I, I will have to check for each j or
We can check for consecutive only.
Just count the number of soldiers in each row, store it in a vector of pairs where first value will be number of soldiers and second value will be row index. Sort the vector and display the first k row indices.
Thanks for this Awesome Method Sir.
Welcome. Please mark your doubt as resolved now.
Bro wo pehle waala doubt please clear krdete
Ya rehnedu?
The approach of your code is not right I guess. So I suggest you to attempt this question with the approach I told you as it is easy to understand and code.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.