반응형

ETC/Algorithm 8

[LeetCode] Add Two Numbers (못풀었다)

문제 출처 : 릿코드 (https://leetcode.com/problems/add-two-numbers/) 문제 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 return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. 두 개의 음이 아닌 정수를 ..

ETC/Algorithm 2021.11.30

[LeetCode] problem 1. Two Sum (Using HashMap)

지난번에 Two-Sum을 BruteForce 방식으로 풀고 나서 시간을 단축하기 위해 HashMap을 쓰고 싶다 라는 생각을 했었다. [LeetCode] problem 1. Two Sum Description. 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 so.. itkevin.tistory.com 오늘 코드 리뷰 이전까지 바쁘다는 핑계로 시도를 못했지만 오늘 다른 스터디원들의 친절하고 자세한 코드 리뷰를 듣고 용기를 내어 다시 풀어봐야겠..

ETC/Algorithm 2021.11.25

[LeetCode] problem 1. Two Sum

Description. 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 twice. You can return the answer in any order. 이 문제를 보고 가장 처음 든 생각 1. 반복문을 돌려야 되는데 중복을 피해야겠다 2. 정렬을 해야할까? 였다. 첫 번째 풀이 [통과] : "반복문을 돌려야 하는데 중복을 피해야겠다"라는 생각을 갖고 돌려봤..

ETC/Algorithm 2021.11.23
반응형