Anyone find a solution using string, or is there anything related with string in this problem? Thanks!
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.