We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
how did you decide to loop through keyboards first and then drives. Shouldn't the array that is larger, should be the outer loop and the smaller in the inner loop? Your code passes all the test cases, but this was how I was thinking. I had the exact same code except, I was first checking the sizes of both arrays to determine how to iterate and compare between two.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Electronics Shop
You are viewing a single comment's thread. Return to all comments →
how did you decide to loop through keyboards first and then drives. Shouldn't the array that is larger, should be the outer loop and the smaller in the inner loop? Your code passes all the test cases, but this was how I was thinking. I had the exact same code except, I was first checking the sizes of both arrays to determine how to iterate and compare between two.