function to return the index
def getSubArray ( arr , n , K ) : NEW_LINE INDENT currSum = 0 NEW_LINE prevDif = 0 NEW_LINE currDif = 0 NEW_LINE result = [ - 1 , - 1 , abs ( K - abs ( currSum ) ) ] NEW_LINE resultTmp = result NEW_LINE i = 0 NEW_LINE j = 0 NEW_LINE while ( i <= j and j < n ) : NEW_LINE DEDENT