Задача 07. Search for a Number, JS Fundamentals (Exercise)
Здравейте. Нуждая се от малко помощ за тази задача. Успях да я напиша, след което ми дава 40/100 в Judge, и тъй като нулевият тест е само един, и той е верен, не мога да видя къде гърми.
Код: https://pastebin.com/yhMhQwxG
Условие:
You will receive two arrays of integers. The second array is contains exactly three numbers.
First number represents the number of elements you have to take from the first array (starting from the first one).
Second number represents the number of elements you have to delete from the numbers you took (starting from the first one).
Third number is the number we search in our collection after the manipulations.
As output print how many times that number occurs in our array in the following format:
"Number {number} occurs {count} times."
Input |
Output |
Comments |
[5, 2, 3, 4, 1, 6], [5, 2, 3] |
"Number 3 occurs 1 times." |
First we take 5 elements from the array. Delete the first 2 elements. |
Поздрави
Ясно, просто съм използвал неправилната функция за случая. Благодаря за отговора и обяснението.
Поздрави