YoungStudyShopping / leetcode_study

https://leetcode.com/problemset/all/
7 stars 0 forks source link

2020-09월 #8

Open occidere opened 3 years ago

occidere commented 3 years ago

2020-09월 알고리즘 자율풀이

occidere commented 3 years ago

2020-09-01 화요일

287. Find the Duplicate Number

occidere commented 3 years ago

2020-09-02 수요일

378. Kth Smallest Element in a Sorted Matrix

iannamkr commented 3 years ago

2020-09-03 목요일

287. Find the Duplicate Number

하... 아직도 긴가민가 하네요.. 내일 다시 풀어봐야겠습니다. 이게 어떻게 정답률이 50%를 넘긴건지 이해가 가질 않네요 ㅠ

Floyd 알고리즘은 몰라서 Set으로 해결하긴 했는데..Scala로 짜려니 은근 귀찮(?)네요

occidere commented 3 years ago

2020-09-03 목요일

797. All Paths From Source to Target

occidere commented 3 years ago

2020-09-07 월요일

829. Consecutive Numbers Sum

occidere commented 3 years ago

2020-09-09 수요일

322. Coin Change

간만에 클래식한 문제네요 ㅎㅎ

occidere commented 3 years ago

2020-09-14 월요일

1396. Design Underground System

occidere commented 3 years ago

2020-09-15 화요일

128. Longest Consecutive Sequence

occidere commented 3 years ago

2020-09-17 목요일

239. Sliding Window Maximum

occidere commented 3 years ago

2020-09-21 월요일

143. Reorder List

seungdols commented 3 years ago
  1. Make Two Arrays Equal by Reversing Sub-arrays

양아치 풀이...ㅋㅋ

int[] bucket = new int[1001];
        for (int i = 0; i < target.length; ++i) {
            bucket[target[i]]++;
            bucket[arr[i]]--;
        }

        for (int i : bucket) {
            if (i > 0) return false;
        }

        return true;

이런 풀이법을 봤는데 신박해서 놀랍다......

occidere commented 3 years ago

2020-09-25 금요일

1060. Missing Element in Sorted Array

occidere commented 3 years ago

2020-09-30 수요일

  1. Accounts Merge

솔루션 참고함

풀이 실패 원인

  • Set을 바탕으로 연속 merge를 시도했으나, 언제까지 merge 하고 종료해야 하는지 식을 세우는데 실패
  • Union-Find로 풀려 했으나 구현 방법 까먹음
  • Union-Find 구현 코드 참고함
seungdols commented 3 years ago

2020-09-30 - 10-01

알고리즘 어린이니까 쉬운걸로 고고