Why "wke" selected as substring in this example and why not "kew"?


  • 0
    I

    Given "pwwkew", the answer is "wke", with the length of 3. Note that the answer must be a substring, "pwke" is a subsequence and not a substring.

    I do not understand that in the Example # 3, it mentions 'wke' as the longest substring. Why not "kew" selected as the longest one? Help here is much appreciated.


Log in to reply
 

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