누적합

코딩 테스트/LeetCode

[4월 6일] Longest Substring Without Repeating Characters

1. 문제 : Longest Substring Without Repeating Characters 문제 설명 Given a string s, find the length of the longest substring without repeating characters. 제한 사항 0 =now){ now = st.lastIndexOf(it)+1; } st.push(it); }else{ st.push(it); } arr.push(st.length-now); }) return Math.max(...arr) }; s를 순환을 하며 st에 하나씩 집어 넣었다. 그리고 now라는 변수를 만들어, 문자가 곂치지 않는 마지노선을 정의하였다. => arr.push(st.length-now)로 값을 arr에 추가하였다. ..

피터s
'누적합' 태그의 글 목록