Company: Boeing
Difficulty: medium
Number with Maximum Occurrence of Digit K Problem Description Implement the following function: ``` def NumWithMaxK(k, arr): ``` The function accepts a digit 'k' and a positive integer array 'arr' of size n. Implement the function to find the number in 'arr' that has the maximum occurrence of digit 'k'. Note: Return -1 if array is null (in case of python, none). Return 0 if no number with digit 'k' is present in array. Examples Example 1: ``` Input: k = 2, arr = [37, 823, 122, 2322, 6017] Output: 2322 ``` Explanation: Occurrence of digit 2 in each element of arr: Digit 2 in 37 = 0 Digit 2 in 823 = 1 Digit 2 in 122 = 2 Digit 2 in 2322 = 3 Digit 2 in 6017 = 0 Maximum occurrence of digit 2 is in 2322, thus, output is 2322. Example 2: ``` Input: k = 1, arr = [2153, 65, 1, 12, 11, 1111] Output: 1111 ``` Constraints 0 <= k <= 9 The array arr will contain positive integers. Only one number has the maximum occurrence of digit k. Follow-up Custom Input Format: For testing purposes, the input wi