알고리즘

    [번역] 14가지 패턴으로 코딩 인터뷰 완전 정복하기

    [번역] 14가지 패턴으로 코딩 인터뷰 완전 정복하기

    *이번 포스팅은 "14 Patterns to Ace Any Coding Interview Question" 을 번역한 내용입니다. 코딩 인터뷰를 준비하는 과정은 많은 개발자들이 불안에 떨게 만듭니다. 엄청난 양의 내용을 커버해야하고, 개발자가 실제 업무하는 일과는 무관하게 느껴지기 때문에 스트레스를 가중합니다. 이런 이유 때문에 개발자들 사이에서는 수백가지의 인터뷰 문제들을 LeetCode같은 사이트를 이용해서 공부하는게 일상이 되었습니다. 불안한 개발자들이 인터뷰 전에 가장 많이하는 질문은 보통 내가 연습 문제 충분히 많이 풀었나? 더 해야하나? 입니다. 이런 이유 때문에 이번 글을 통해서 각 질문들의 기저에 깔려있는 패턴들을 다뤄보려고 합니다. ⎯ LeetCode에서 수백개의 문제를 풀면서 고통받지..

    [LeetCode] 53. Maximum Subarray

    [LeetCode] 53. Maximum Subarray

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. https://leetcode.com/problems/maximum-subarray/ Maximum 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 문제 해설 입력 값으로 nums 라는 배열이 들어오고, 배열에는 최소 하나의 정수가 존재한다. 배열 원소들 중 연속되는 subarray의 합이 최대가 되는 값을 찾아 return 해야 한..

    [LeetCode] 238. Product of Array Except Self

    [LeetCode] 238. Product of Array Except Self

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. 문제: 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 배열에서 현재 요소를 뺀 나머지 요소들을 곱한 값을 그 자리에 넣어서 Return 해야한다. 1. 입력한 리스트와 같은 크기의 리스트를 ..

    [LeetCode] 217. Contains Duplicate

    [LeetCode] 217. Contains Duplicate

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. 문제: https://leetcode.com/problems/contains-duplicate/ Contains Duplicate - 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 풀이: class Solution: def containsDuplicate(self, nums: List[int]) -> bool: # Sol 1 -- O(n) # dist..

    [LeetCode] 121. Best Time to Buy and Sell Stock

    [LeetCode] 121. Best Time to Buy and Sell Stock

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. 문제: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Best Time to Buy and Sell Stock - 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 풀이: class Solution: def maxProfit(self, prices: List[int]) -> int: if ..

    [LeetCode] 1. Two Sum

    [LeetCode] 1. Two Sum

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. 문제: https://leetcode.com/problems/two-sum/ Two Sum - 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 풀이: class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: nums_dic = {} # Stores the dictionary..

    [선형 자료구조] 1. Array

    [선형 자료구조] 1. Array

    데이터 요소가 순차적으로 배열되는 자료구조를 선형(Linear) 자료구조라고 한다. 선형 자료구조는 단일 레벨로 구성된다. 배열, 스택, 큐, 연결 리스트 등이 모두 선형 자료구조에 속한다. 배열 C 언어를 기준으로 배열을 설명해보면, 배열은 크기를 지정하고 해당 크기만큼의 연속된 메모리 공간을 할당받는 작업을 수행하는 자료형을 말한다. 크기가 고정되어 있기 때문에 한번 생성하면 크기를 변경하는것이 불가능하다. 예를 들어 정수형 요소 3개로 이뤄진 배열을 생성하면 다음 그림처럼 물리 메모리에 배열 요소 값들이 순서대로 배치된다. int arr[3] = { 3, 6, 9 }; 최신 시스템(32비트 이상)과 컴파일러 기준으로 int를 4바이트로 사용한다. 따라서 가리키는 주소는 1바이트마다 1씩 증가한다. ..

    [개발서적리뷰] 파이썬 알고리즘 인터뷰 / 득템!!!

    [개발서적리뷰] 파이썬 알고리즘 인터뷰 / 득템!!!

    생활코딩 페이스북 그룹에 저자 박상길님이 올려주신 이벤트에 당첨되었습니다. 책을 받아봐서 두루 살펴봤는데 어찌나 감동이던지... 지금까지 봐온 알고리즘 책들 중에서 가장 읽기도 편하고 보기도 편한 책이었습니다. 일러스트들이 눈에 쏙쏙 들어오고, 최근 트렌드로 핫한 leetcode 사이트 문제 95개를 중심으로 중요한 알고리즘 개념 뿐만 아니라 코딩 인터뷰 시 알아야할 여러 지식들과 요령을 가르쳐줍니다..! 초반부터 C++과 Go, Typescript 등 요즘 핫한 언어들과 비교도 해주면서 알아두면 유용한 팁들 많이 알려주시네요. 어쩌면 저처럼 이런 저런 책들 전전하고 뻘짓을 많이 해본 분들에게 더 감동을 가져다줄 수 있는 책 같아요. 챕터가 단계별로 자료구조와 함께 대표 문제풀이가 잘 정리되어 있어서 좋..