QUESTION
PLEASE ANSWER IN JAVA SCRIPT
Given an array of integers a, your task is to calculate the digits that occur the most number of times in the array. Return the array of these digits in ascending order. Example For $a=[25,2,3,57,38,41]$, the output should be solution $(a)=[2,3,5]$. Here are the number of times each digit appears in the array: \[ \begin{array}{lll} 0 & \rightarrow> & 0 \\ 1 & -> & 1 \\ 2 & -> & 2 \\ 3 & \rightarrow & 2 \\ 4 & \rightarrow & 1 \\ 5 & \rightarrow & 2 \\ 6 & \rightarrow> & 0 \\ 7 & \rightarrow & 1 \\ 8 & \rightarrow & 1 \end{array} \]
Related Questions