목록분류 전체보기 (7)
Bunker
문제 https://leetcode.com/problems/jewels-and-stones/ Jewels and Stones - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 풀이 간단한 문자 변환 프로그램이다. A~Z, a~z만 입력되므로, 이를 53크기 int 배열에 넣고 유/무를 기록해서 stone_count 증가에 사용했다. (index 0은 헷갈려서 사용하지 않았으므로 53크기로 선언함) 고찰 leetcode 풀 때의 주의점* 회사 시험과 마찬가지로....
문제 https://leetcode.com/problems/spiral-matrix/ 풀이 정석대로 풀었다. 1) 반복 호출되는 함수를 정의한다. 이 함수는 start_i, start_j, size_m, size_n을 input으로 받아 한 번에 한 까치의 바깥쪽 직사각형을 dest 배열에 집어넣는다. (양파 벗기듯이) 2) 반복 호출되는 함수에는 1씩 점증하는 start_i 및 start_j와, 2씩 줄어드는 size_m 및 size_n이 input으로 주어진다. 고찰 하루가 꼬박 걸린 코드다. 직관적인 아이디어였건만... 인덱스를 다루는 구현 연습이 많이 필요하겠다. size방어를 제대로 못해서 if 문이 들어가있는 것도 큰 패착이다. 코드 https://github.com/suy-lee/algori..
문제 https://leetcode.com/problems/first-missing-positive/ First Missing Positive - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 풀이 1) Merge Sort를 이용하여 리스트에 있는 숫자를 먼저 오름차순으로 정리 2) 가장 작은 수를 1로 설정하고, - 0보다 작거나 같은 element는 skip - 현재의 가장 작은 수와 동일한 element가 나올 경우, 작은 수를 +1 - 현재의 가장 작은 ..
https://gmlwjd9405.github.io/2018/05/08/algorithm-merge-sort.html [알고리즘] 합병 정렬(merge sort)이란 - Heee's Development Blog Step by step goes a long way. gmlwjd9405.github.io

문제 *7/24 풀이본 https://leetcode.com/problems/product-of-array-except-self/ Product of Array Except Self - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 특이사항 Product of - '곱셈'이라는 뜻을 상기함. Division을 사용하지 말라는 요구사항을 제대로 읽지 못함. 요구사항을 제대로 읽을 것. returnSize를 넣어주지 않으면 Caller가 Expected Output..