Doubt in the third question

In the third question he multiplied (N/K) with (K) times but my question is why did he multiply with K as in all the previous prob the value is being added and not multiplied

hi @kartikey.rajput0071 here in third case the value of i is not increased by 1 as in earlier 2 cases, rather there is a jump of k steps every time thats why, i = i + j (ans j is equal to k every time after running the while loop)
hence its N/K and the loop runs for K times so it gets multiplied

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.