Why this problem is tagged as "string"?

  • 0

    Anyone find a solution using string, or is there anything related with string in this problem? Thanks!

  • 1

    I think this problem is similar to https://leetcode.com/problems/minimum-window-substring/. I use a map to store the corresponding list indices for a key (key is numeric value showed in nums). And the map's keys actually form a "string" (since in C++, keys are sorted automatically). Then by using two pointers technique, we can have a similar solution to the one of minimum window substring.

Log in to reply

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