Please correct my logic. Thanks
Some test cases not working
it is mentioned in the question that the k can be greater then the n so you have to handle that case as well.
you can handle that by doing taking modulus.
Please correct my logic. Thanks
it is mentioned in the question that the k can be greater then the n so you have to handle that case as well.
you can handle that by doing taking modulus.