5. Must be written in Javascript [Problem Description] You are given an array of numbers arr. Complete the solution, a f

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

5. Must be written in Javascript [Problem Description] You are given an array of numbers arr. Complete the solution, a f

Post by answerhappygod »

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;
}
//
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply