Company: Autodesk SDE intern on campus_9april
Difficulty: medium
You are given an array of non-negative integers a . Your task is to calculate how many elements of a have an odd number of occurrences of the digit 0 . For example, for [4, 50, 100, 65, 2000, 700, 1, 10] , the answer should be 3 . These numbers are 50 , 2000 and 10 . Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(a.length 2 ) will fit within the execution time limit. Example For a = [20, 11, 10, 10070, 7] , the output should be solution(a) = 3 . In a[1] = 11 and a[4] = 7 the digit 0 does not occur, so these elements do not count (since zero is an even number). In a[0] = 20 and a[2] = 10 the digit 0 occurs one time (which is an odd number), so these elements do count. In a[3] = 10070 the digit 0 occurs three times (which is an odd number), so this element counts. Input/Output [execution time limit] 0.5 seconds (cpp) [memory limit] 1 GB [input] array.integer a An array of integers. Guaranteed constraints: 1 ≤ a.length