3. Must be written in Javascript **Problem Description** You are given an array of numbers nums and a number n. At this

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

3. Must be written in Javascript **Problem Description** You are given an array of numbers nums and a number n. At this

Post by answerhappygod »

3.
Must be written in Javascript
**Problem Description**
You are given an array of numbers nums and a number n.At this time, complete the solution, a function that returns thesmallest index among the same numbers as n in nums.
[Restrictions]
- If there is no number matching n in nums, it returns '-1'.
[Input format]
- nums is an array of length 100 or less consisting of integersbetween 1 and 100 and less than or equal to 100.
- n is an integer greater than or equal to 1 and less than orequal to 100.
[Output Format]
- Returns the smallest index within nums that matches n.
//
function solution(nums, n) {
var answer = 0;
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