LeetCode 6

[leetcode 198. python] 집 도둑 (House Robber) 풀이

https://leetcode.com/problems/house-robber/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 문제 당신은 프로페셔널한 도둑이다. 길을 따라 있는 집의 돈을 훔치려한다. 딱 한 가지 제약은, 하루동안 바로 옆에 인접(adjacent)해 있는 집의 돈을 훔칠 시, 경찰과 연결된 보안경보가 자동으로 울린다는 사..

Algorithm/LeetCode 2024.01.23

[leetcode 206.python] 역순 연결 리스트 (Reverse Linked List) 풀이

https://leetcode.com/problems/reverse-linked-list/ Reverse Linked List - LeetCode Can you solve this real interview question? Reverse Linked List - Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: [https://assets.leetcode.com/uploads/2021/02/19/rev1ex1.jpg] Input: head = [1,2,3,4,5] O leetcode.com 본 포스팅은 책에서 다룬 리트코드 문제들을 다루고 있으며, 문제 풀이의 많은 부분을 책의..

Algorithm/LeetCode 2024.01.08

[leetcode 225.python] 큐를 이용한 스택 구현 (Implement Stack using Queues) 풀이

https://leetcode.com/problems/implement-stack-using-queues/ Implement Stack using Queues - LeetCode Can you solve this real interview question? Implement Stack using Queues - Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and empty). Implement the leetcode.com 문제 Implement a last-in-first..

Algorithm/LeetCode 2024.01.04

[leetcode 561.python] 배열 파티션 1(Array-partition 1) 풀이

https://leetcode.com/problems/array-partition/ Array Partition - LeetCode Can you solve this real interview question? Array Partition - Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum. leetcode.com 문제 Given an integer array nums of 2n integers, group t..

Algorithm/LeetCode 2024.01.03

[leetcode 49.python] 그룹 애너그램 (Group Anagrams) 풀이

https://leetcode.com/problems/group-anagrams/ Group Anagrams - LeetCode Can you solve this real interview question? Group Anagrams - Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase leetcode.com 문제 Given an array of strings strs, group the anagrams to..

Algorithm/LeetCode 2024.01.03