Base case 1 2 3 and edge case 1 is failing

Can anyone help me with these test cases

@tanujsharma1412 Hey tanuj your code from (Line 32 - 38) will not handle all the cases where K is greater N(I assume you wrote that piece to handle this case however it’s failing)

Suggestion : Try working with modulo (%) operator

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.