Read the limits first
transcript
Two hundred thousand builds. Compare every pair? Read the limits first.
Nearly twenty billion checks. About two hundred seconds. Far over one second. A short statement can hide a big job. Sort the builds first instead. A minute of counting saves hours.
Sort first instead. Three point four million steps. Thirty four milliseconds. The limit tells you the size. Then compare only neighbours. Then write the code.
Twenty six allows two to the n. Four sixty four allows n cubed. Ten thousand allows n squared. The pair method is correct. That fits well inside a second. Limits first, always.
Four and a half million allows n log n. A hundred million allows one pass. It is also far too slow here. Method choice is a count, not a guess.
The limit names the class. Pick a method that fits it. You know this before you code. Do the count in your head.
The limits pick the method. Full breakdown in the lecture.