Early return if distance == 1


  • 0
    S

    As stated in the title, we don't have to test every distance, if ever meet 1 return. This will prune a lot of comparisons.


Log in to reply
 

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