Javascript/LeetCode 썸네일형 리스트형 3. Longest Substring Without Repeating Characters (LeetCode, Javascript) 이 문제는 문자의 패턴 중 동일 문자가 없도록 하는 가장 긴 서브셋을 찾는 문제입니다. 간단하게 앞에서부터 탐색해가면서 문제를 풀 수 있습니다. 다만 주의할 점은 abcbead 라는 String이 있는 경우 2번째 b를 만나는 지점에서 abcbead 이렇게 분리를 하게 된다면, 정답을 찾기 어렵습니다. 이를 해결하기 위해 슬라이딩 윈도우나 투 포인터 방식과 같이 두 개의 포인터를 사용하여 탐색 해 나가면 되며, 이를 HashMap을 이용하는 방식으로 응용할 수 있습니다. 자세한 설명은 아래에서 계속하겠습니다. * Problem Given a string s, find the length of the longest substring without repeating characters. * 문자열 s 가 주.. 더보기 2. Add Two Numbers Add Two Numbers 문제는 2개의 Linked List의 합을 구하는 문제입니다. 각 Node에는 0~9 값이 있고, 자리수가 1의 자리부터 증가 합니다. 문제는 간단히 한자리씩 더하면서 노드를 만들어 나가면 되는 문제입니다. 단, 처음부터 Number형으로 변경하여 계산 시 Overflow에 빠질 수 있으니 유의해야 합니다. * Problem You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and retur.. 더보기 1. Two Sum 최근 직장동료들과 함께 LeetCode를 하루 한 문제씩 도전하고 있습니다. 어려운 문제도, 쉬운문제도 있는데 오랜만에 20대 때의 마음을 가지고 편하게 즐겁게 임하고 있습니다. Two Sum 문제는 매우 쉽지만, 2가지 정도로 해결할 수 있을 것 같습니다. 문제를 먼저 살펴보겠습니다. * 문제 살펴보기 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twic.. 더보기 이전 1 다음