We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c66bbbc commit 394febbCopy full SHA for 394febb
โlongest-substring-without-repeating-characters/sungjinwi.cpp
@@ -10,7 +10,12 @@
10
๋ฌธ์์ด ์ ์ฒด์ ๋ํด 1ํ ์ํ
11
12
SC : O(N)
13
- ํด์ํ ์ด๋ธ unordered_set์ ํฌ๊ธฐ๋ ๋ฌธ์์ด ๊ธธ์ด์ ๋น๋ก๋ก
+ ํด์ํ ์ด๋ธ unordered_set์ ํฌ๊ธฐ๋ ๋ฌธ์์ด ๊ธธ์ด์ ๋น๋ก
14
+
15
+ ์ถ๊ฐ์ ์ธ ์ต์ ํ ๋ฐฉ๋ฒ :
16
+ int lastIdx[256] ์ ์ธํ๊ณ ์์คํค์ฝ๋ ์์น์ ๋ง์ง๋ง์ผ๋ก ํด๋น ๋ฌธ์๊ฐ ๋์จ ์ธ๋ฑ์ค๋ฅผ ์ ์ฅํ๋ค
17
+ ex) a๊ฐ 10๋ฒ์จฐ ์ธ๋ฑ์ค์์ ๋์ค๋ฉด lastIdx['a'] = 10;
18
+ ๋์ค์ ์ค๋ณต๋๋ ๋ฌธ์๋ฅผ ๋ง๋๋ ๊ฒฝ์ฐ left๋ฅผ 1์ฉ ์ ์ง์ํค๋ ๊ฒ์ด ์๋๋ผ ์ค๋ณต๋ ๋ฌธ์์ ๋ง์ง๋ง ๋ฐ๋ก ๋ค์์ผ๋ก left๋ฅผ ์ ๋ฐ์ดํธ
19
*/
20
21
#include <unordered_set>
0 commit comments