Check whether an Array can be made 0 by splitting and merging repeatedly | Function that finds if it is possible to make the array contain only 1 element i . e . 0 ; Check if element is odd ; According to the logic in above approach ; Driver code
def solve ( A ) : NEW_LINE INDENT ctr = 0 NEW_LINE for i in range ( len ( A ) ) : NEW_LINE INDENT if A [ i ] % 2 == 1 : NEW_LINE INDENT ctr += 1 NEW_LINE DEDENT DEDENT if ctr % 2 == 1 : NEW_LINE INDENT return ' No ' NEW_LINE DEDENT else : NEW_LINE INDENT return ' Yes ' NEW_LINE DEDENT DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT arr = [ 9 , 17 ] NEW_LINE print ( solve ( arr ) ) NEW_LINE DEDENT