In the following code snippet, there is a function find_zero…
Questions
In the fоllоwing cоde snippet, there is а function find_zeros_аnd_ones. This function counts how mаny occurrences of integer values 0 and 1 there are in an input list, and returns the count as a list with two elements. This code has multiple for-loops in its implementation. What is the time complexity of the following code snippet? def find_zeros_and_ones(numbers): zero_counter = 0 for i in range(len(numbers)): if numbers[i] == 0: zero_counter += 1 one_counter = 0 for i in range(len(numbers)): if numbers[i] == 1: one_counter += 1 return [zero_counter, one_counter]