Check if the first K elements forms a number which is divisible by 3
while ( i < k ) : NEW_LINE INDENT sm += arr [ i ] NEW_LINE i += 1 NEW_LINE DEDENT if ( sm % 3 == 0 ) : NEW_LINE INDENT ans = [ ( 0 , i - 1 ) ] NEW_LINE found = 1 NEW_LINE DEDENT