Hi... I have another array problem.
The level is easy, but it is hard for me.
However, I won't give up; I'll do my best.
Anyway, to summarize this problem, I just need to check the unique count.
So, I used the Map object and Set.
Here is my answer.
First, I convert the array to a Map, where the Map is [key, value], so I add the count as the value.
Then, I initialize the Set because a Set can check for duplicated values.
Since that characteristic, I can check for duplicate factors.
'열정가득한 개발자의 이야기 > Javascript Algorithm' 카테고리의 다른 글
3005. Count Elements With Maximum Frequency (javascript) (3) | 2024.09.28 |
---|---|
392. Is Subsequence (Javascript) (0) | 2024.09.23 |
58. Length of Last Word (Javascript) (1) | 2024.09.22 |