Home
Deercode
Cancel

[LeetCode Solution] 88. Merge Sorted Array

Problem Description LeetCode 88. Merge Sorted Array Given two ascending order lists, merge them into a single sorted list. However, there is a condition: the sorting must be done in-place on the n...

[LeetCode Solution] 80. Remove Duplicates from Sorted Array II

Problem Description LeetCode 80. Remove Duplicates from Sorted Array II Remove duplicates from the array, keeping at most two occurrences of each element. Solution Approach: Two Pointer I used tw...

[LeetCode Solution] 27. Remove Element

Problem Description LeetCode 27. Remove Element Algorithm to remove the specified value (val) from the list and determine the remaining number of elements. Solution Approach 1. 1) Traverse nums a...

[LeetCode Solution] 26. Remove Duplicates from Sorted Array

Problem Description LeetCode 26. Remove Duplicates from Sorted Array Algorithm to remove duplicates from a sorted array and return the value of the remaining elements. Solution Approach: Two Poin...

[LeetCode Solution] 169. Majority Element

Problem Description LeetCode 169. Majority Element Find the element that appears more than n/2 times in a list. Solution Approach: Two Pointer 1) Traverse the entire list and create a dictionary....

[kubernetes] How to Check Expiry Date of k8s Client Config Certificates

Kubernetes Certificate Expiry Alert A client certificate used to authenticate to the Kubernetes API server is expiring in less than 7.0 days. If you see a message like the one above on your k8s cl...

[Linux] Managing Program Versions with update-alternatives

update-alternatives Command I first came across this command when I was looking for an easy way to switch between multiple versions of PHP installed locally. The update-alternatives command is a Li...

[python] Learn Basic Template Codes for DFS/BFS in Python

Graph Traversal When it comes to graph traversal, there are commonly used techniques: Depth-First Search (DFS) and Breadth-First Search (BFS). DFS is generally more widely used than BFS, and it’s a...

Effective Python 파이썬 코딩의 기술 요약 정리 (Chapter 3. 함수)

19. 함수가 여러 값을 반환하는 경우에는 절대로 네 값 이상을 언패킹하지 말라 이건 그냥 함수 리턴 값을 아래와 같이 많이 쓰지 말라는 얘기. min, max, avg, med, count = get_stats(lengths) 개발자가 헷갈릴 가능성이 크다. 이건 너무 당연한거라 패쓰. 20. None을 반환하기 보다는 예외를 발생시켜라 ...

Effective Python 파이썬 코딩의 기술 요약 정리 (Chapter 2. 리스트와 딕셔너리)

11. 시퀀스를 슬라이싱하는 방법을 익혀라 슬라이싱이란 시퀀스를 여러 조각으로 나누는 방법이다. 슬라이싱은 최소한의 노력으로 시퀀스에 들어있는 아이템의 부분집합에 접근할 수 있게 해준다. 슬라이싱의 기본 형태는 리스트[시작:끝]이다. 시작인덱스는 포함되지만, 끝 인덱스는 포함되지 않는다. a = [1, 2, 3, 4, 5] print(a[3:5]...