5. Must be written in Javascript [Problem Description] You are given an array of numbers arr. Complete the solution, a f
Posted: Fri Jul 01, 2022 5:39 am
5.Must be written in Javascript
[Problem Description]
You are given an array of numbers arr. Complete thesolution, a function to find out whether the number of duplicatenumbers in arr is unique.
For example, for arr [1, 3, 5, 4, 3, 1, 1]
- There are three of 1,
- There are two of 3,
- There is one of 4,
- Since there is one of 5
The result is false because the number of duplicatedigits in numbers 4 and 5 is not unique.
[Input format]
- arr is an array of length 1 or more and 100 or less.
- The element of arr is an integer greater than or equal to 1and less than or equal to 10.
[Output Format]
- Determines whether the number of duplicated numbers isunique.
//
function solution(arr) {
var answer = true;
return answer;
}
//
[Problem Description]
You are given an array of numbers arr. Complete thesolution, a function to find out whether the number of duplicatenumbers in arr is unique.
For example, for arr [1, 3, 5, 4, 3, 1, 1]
- There are three of 1,
- There are two of 3,
- There is one of 4,
- Since there is one of 5
The result is false because the number of duplicatedigits in numbers 4 and 5 is not unique.
[Input format]
- arr is an array of length 1 or more and 100 or less.
- The element of arr is an integer greater than or equal to 1and less than or equal to 10.
[Output Format]
- Determines whether the number of duplicated numbers isunique.
//
function solution(arr) {
var answer = true;
return answer;
}
//