Answer:
It is <em>definitely </em>D.
Explanation:
I am a gamer myself so this question is easy for me. It's slim to none to be wrong when you view my answer!!!
5 I don’t think it’s good. I thought it was boring.
Answer:
Check the explanation
Explanation:
Keep two iterators, i (for nuts array) and j (for bolts array).
while(i < n and j < n) {
if nuts[i] == bolts[j] {
We have a case where sizes match, output/return
}
else if nuts[i] < bolts[j] {
what this means is that the size of nut is lesser than that of bolt and we should go to the next bigger nut, i.e., i+=1
}
else {
what this means is that the size of bolt is lesser than that of nut and we should go to the next bigger bolt, i.e., j+=1
}
}
Since we go to each index in both the array only once, the algorithm take O(n) time.