Function to count number of 1 's in the array after performing N moves
def countOnes ( arr , N ) : NEW_LINE INDENT for i in range ( 1 , N + 1 , 1 ) : NEW_LINE INDENT for j in range ( i , N + 1 , 1 ) : NEW_LINE DEDENT DEDENT