title: Check If All The Elements Can Be Made Of Same Parity By Inverting Adjacent Elements
signature: function check_if_all_the_elements_can_be_made_of_same_parity_by_inverting_adjacent_elements(a, n)
source_py: def check_if_all_the_elements_can_be_made_of_same_parity_by_inverting_adjacent_elements(a, n):
      count_odd = 0
      count_even = 0
      for i in range(n):
          if (a[i] & 1):
              count_odd += 1
          else:
              count_even += 1
      if ((count_odd % 2) and (count_even % 2)):
          return False
      else:
          return True
source_cpp: bool check_if_all_the_elements_can_be_made_of_same_parity_by_inverting_adjacent_elements(vector<int> a, int n) {
    int count_odd = 0, count_even = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      if ( a [ i ] & 1 ) count_odd ++;
      else count_even ++;
    }
    if ( count_odd % 2 && count_even % 2 ) return false;
    else return true;
  }