[Leetcode] 3.Longest Substring Without Repeating Characters(unordered_map)

通過把未訪問的結點放到unordered_map中來判斷是否重複,代碼如下: 1 class Solution { 2 public: 3 int lengthOfLongestSubstring(string s) { 4 if(s == "") 5 return 0; 6 unordered_map<char,int>
相關文章
相關標籤/搜索