Question 6
You are given a non-empty list of integers with a specific structural property: all odd numbers appear before all even numbers in the list. Within their respective groups, the numbers are not sorted and can appear in any random order. Furthermore, the exact counts of odd and even numbers are not given and could be anything (for instance, the list could contain all odds, all evens, or any arbitrary mix of both). For example: (where all odds come before all evens). What is the time complexity of the most efficient algorithm to find the exact count of odd numbers and even numbers in this list?
—
—
—
—