lines 2, 4, and 6 each require o("m") time. however, line 2 is only executed once, and line 6 is only executed if the hash values match, which is unlikely to happen more than a few times. line 5 is executed o("n") times, but each comparison only requires constant time, so its impact is o("n"). the issue is line 4.