How do you even think of getting an O(n) solution for this?

  • 1

    I had absolutely no idea how to even approach this... how are we expected to do this exactly?

  • 0

    I feel it's a shame no one's answered your question since posting it. I'm wondering the same, and have no idea why solutions with no explanations get up voted so much.

Log in to reply

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