Home
Deercode
Cancel

[Leet Code풀이] 189. Rotate Array

문제 설명 https://leetcode.com/problems/rotate-array/description/?envType=study-plan-v2&envId=top-interview-150 리스트를 k만큼 회전시키는 문제 풀이 접근 방법. [1,2,3,4,5,6,7]에서 k=3인 경우 단순히 루프를 돌면서 i를 k만큼 옮기면서 이동시키면...

[Leet Code풀이] 122. Best Time to Buy and Sell Stock II

문제 설명 https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/description/?envType=study-plan-v2&envId=top-interview-150 주식에서 샀다 팔았다 해서 최고 수익이 얼마나 날 수 있는지를 계산한다. Best Time to Buy and ...

[Leet Code풀이] 121. Best Time to Buy and Sell Stock

문제 설명 https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/?envType=study-plan-v2&envId=top-interview-150 주식에서 한번 샀다 팔았다 해서 최고 수익이 얼마나 날 수 있는지를 계산한다. 풀이 접근 방법. 한번 샀다 팔았을때...

[Leet Code풀이] 88. Merge Sorted Array

문제 설명 https://leetcode.com/problems/merge-sorted-array/description/?envType=study-plan-v2&envId=top-interview-150 오름차순으로 주어진 두개의 리스트를 오름차순으로 정렬하는 문제이다. 다만 조건이 있는데, nums1 배열에 in-place방식으로 정렬을 해...

[Leet Code풀이] 80. Remove Duplicates from Sorted Array II

문제 설명 https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/description/?envType=study-plan-v2&envId=top-interview-150 배열에서 중복은 최대 2개만 남기고 제거하는 문제 풀이 접근 방법. Two pointer two poi...

[Leet Code풀이] 27. Remove Element

문제 설명 https://leetcode.com/problems/remove-element/description/?envType=study-plan-v2&envId=top-interview-150 val로 주어진 값을 리스트에서 제거한 후, 해당 리스트에 요소가 얼마나 남았는지를 알아내는 알고리즘 풀이 접근 방법 1. 1) val이 num...

[Leet Code풀이] 26. Remove Duplicates from Sorted Array

문제 설명 https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/?envType=study-plan-v2&envId=top-interview-150 배열에서 중복값을 제거한후 남은 원소의 값을 리턴하는 문제 풀이 접근 방법. Two pointer two p...

[Leet Code풀이] 169. Majority Element

문제 설명 https://leetcode.com/problems/majority-element/description/?envType=study-plan-v2&envId=top-interview-150 리스트에서 과반수를 차지하는 원소를 찾아내는 문제 풀이 접근 방법. Two pointer 1) 전체 원소를 돌면서 딕셔너리를 만듦 2) 만들어...

[kubernetes] k8s client config 인증서 만료일 확인하는 방법

Kubernetes certificate 인증 만료 알람 a client certificate used to authenticate to kubernetes apiserver is expiring in less than 7.0 days. k8s 클러스터에 위와 같은 메세지가 뜨면 kube config에 명시된 인증서가 만료일이 다가오고 있다는 것이다...

[linux] update-alternatives로 프로그램 버전 관리하기

update-alternatives 명령어 이 명령어를 처음 알게 된 것은 로컬에 여러 버전의 php가 깔렸을때 버전을 쉽게 바꾸는 방법을 찾다가 알게 되었다. update-alternatives 명령어는 심볼링 링크를 관리해주는 리눅스 프로그램이다. 그럼 여러 php 버전이 설치된 상황에서 update-alternatives를 사용하는 시나리오를...