Given a binary array, count the number of 0s and 1s in a single pass.
Implement count_binary_values(nums), which accepts a list containing only 0 and 1 values and returns [zero_count, one_count]. The input contains at least one element, and the scan must use O(n) time and O(1) extra space.
def count_binary_values(nums):