You are viewing a single comment's thread. Return to all comments →
I came up with the exact same solution but "Test case #4" fails with a run time error. I downlowded the input and the output for this test case and ran it locally in Visual Studio (C#) and it does not fail.
In test case 4 ..it should be noted that the value of k is greater than the no. of elements in the array(n)
try using mod operator fr this problem
you figured out the time problem bro!!!! great