Queries related to vector

sir, i have provided question as well as my code in the following

i hve following queries related to code

(1) when input is the sample test case, i am not getting the expected output. count is incrementing as every time for loop runs.why count is always equal to h?

(2) when i am removing comments in main() for fast i/o lines, why code is not working?

(3) in iterator for loop it!=v.end() is not working properly,but it<v.end() is working fine. when to use each?

@aman17nov1999 1. this is the correct solution


2.fast io is only required when input is very large so depending upon the input data
the code will not run if you will comment the fast io
3. if you are using an iterator its better to use it!=v.end(),but i think both will work fine.

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.