+ 1
find the two number in the array of 20 whose product(multiplication) is equal to given number by the user.
Javascript use languages
3 Respuestas
0
shiu sakpal Post your attempt first to get help from the community ..
0
Maybe filter() method would work, I don't understand what you are trying to do so I'm not sure.
0
You can put your numbers in the Set, then for each number x check if product / x is in the set.
Another way is to keep numbers in a sorted array and use two-pointer linear search.