You are viewing a single comment's thread. Return to all comments →
This might be a silly question but why x <= 100 ?
x <= 100
this is based on the constraints of the problem. we are told that each value in both arrays are between 1 < x <= 100
ah yes, thanks. I am not use to seeing the constraints accounted for in the code like that.
You're right, why x <= 100?
Excution time may be reduced using max = Math.max(...b) instead of 100 ...
for x > max => b.every(int => (int % x == 0)) return false