Hey, this is the link to this question on leetcode :
and this is the link to my submission for this code :
https://ide.codingblocks.com/s/210752
this is giving a runtime error for the case : [1,-1] , k = 1.
please help me in identifying the problem in my code