전체 글

개발자 이우진의 기술 블로그입니다
https://leetcode.com/problems/group-anagrams/submissions/ Group Anagrams - 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 핵심 아이디어 순서가 다른 문자열은 정렬하면 같은 문자열이 된다 복잡도 시간 복잡도: O(N * KlogK) 문자열 N개 * K길이 문자열 정렬 KlogK 공간 복잡도: O(N) anagrams hash map (이차원처럼 보이지만, 전체 개수는 N개이다) 설명 "문자열 배열을 받아 ..
https://leetcode.com/problems/most-common-word/ Most Common Word - 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 핵심 아이디어 split() 에 정규표현식 /W+/ (not word, 1 or more) 를 사용하여 알파벳만 배열 나눌 수 있다 O(N)인 Array.includes() 보다는 O(1)인 Map.has()가 시간이 적게 걸린다 복잡도 N = 단어의 개수라면, 시간 복잡도: O(N) filter ..
https://leetcode.com/problems/reorder-data-in-log-files/ Reorder Data in Log Files - 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 핵심 아이디어 letterLogs, digitLogs 두 배열로 나눈 뒤 합친다 js string 비교는 String.localeCompare()로 할 수 있다 복잡도 시간 복잡도: O(N^2*logN) sort() NlogN * slice() N 공간 복잡도: O(..
https://leetcode.com/problems/reverse-string/ Reverse String - 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 핵심 아이디어 js에 Array.reverse() 가 있으니 그걸 쓰거나... left, right two pointer로 양쪽에서 반복하며 swap하면 배열이 뒤집어진다 js에서 swap할 때는 destructing asssignment [a,b] = [b,a] 를 활용할 수 있다 복잡도 시간 복잡도: ..
https://leetcode.com/problems/valid-palindrome/ Valid Palindrome - 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 핵심 아이디어 s === s.split("").reverse().join("") 소문자 일괄 변환은 .toLowerCase()로 하고 알파벳 숫자 아닌 문자 거르기는 정규표현식 /[^a-z0-9]/g 를 사용한다 python, c++ 등 deque 자료구조를 지원한다면 deque로 풀 수 있다 맨 ..
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ Find Minimum in Rotated Sorted Array - 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 핵심 아이디어 문제 조건이 O(logN)으로 찾으라고 되어 있으니 binary search를 사용한다 정렬된 array를 rotate해서 binary search를 응용할 수 있다 정렬이 안 맞기 시작하는 지점이 최솟값이니 정렬..
https://leetcode.com/problems/maximum-product-subarray/ Maximum Product Subarray - 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 핵심 아이디어 (n-1)번째 local max 와 연산해서 n번째 local max를 구할 수 있으므로 DP. 그러나 (n-1)번째 지역해만을 사용하기 때문에 배열은 만들지 않고 localMin, localMax 변수 2개로 지역해를 트래킹했다 정수를 곱하면 절댓값이 커..
· misc
UX 이론 - 개발자의 관점에서 from WoojinLee58 유저는 디자이너의 의도(Conceptual Model)를 알 수 없다 개발자는 Conceptual Model을 System Image로 구현하는 사람이다 따라서 개발자는 잘 구현해야 하고, 팀과 구현 관점에서 커뮤니케이션해야 한다 점심시간에 팀원들이랑 소주 한 잔 마시고 "이거 꼭 필요하겠네요!" 하고 열정에 불타올라서 준비했던 발표 타운홀 미팅 때 발표했었다