Sanket and strings :one test case not passing

https://ide.codingblocks.com/s/61997 1st test case is not passing please help

HI Sindhu, pls notice that at first iteration itself only in loop of line no.31 you initialize j=i => j=0 and then in line 34 you access arr[j-1] i.e. arr[-1]. Also, you always keep track of only wether sum is greater than k, but what happens if sum is > k but sum1 is < k. Pls try to fix these bugs and then try again.

Hope this helps :slight_smile: