sir this code is working for 3 test cases but for 4th test cases it is showing runtime error here is the code
Sir doubt in this question
hello @tejasddongare
check the constraints->
ur solution space complexity is O(nk) that is why is showing run error for one case (nk is too much space).
try to solve this in linear space complexity.
refer this->link
sir now i did space optimaztion still its failing one test case why?? rest all test cases are getting passed