How could equals method of String class is so fast?

  • 0

    At first I try to use two for loop to brute-force search but get a runtime limit exceed error.
    but if I change the inner loop to equals method, AC. How could this method be so fast?
    It does not traverse the two string to check if they are equal?

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.