Eat Study Love

먹고 공부하고 사랑하라

Dynamic Programming 18

Guess Number Higher or Lower II[Math,Dynamic Programming,Game Theory]

https://leetcode.com/problems/guess-number-higher-or-lower-ii/description/We are playing the Guessing Game. The game will work as follows:I pick a number between 1 and n.You guess a number.If you guess the right number, you win the game.If you guess the wrong number, then I will tell you whether the number I picked is higher or lower, and you will continue guessing.Every time you guess a wrong n..

Coding_Practice 2024.11.05

Trapping Rain Water[자주 나오는 물 채우기 DP문제][Array,Two Pointers,Dynamic Programming,Stack,Monotonic Stack]

https://leetcode.com/problems/trapping-rain-water/description/Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1:Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]Output: 6Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rai..

Coding_Practice 2024.11.04

Majority Element[Array,Hash Table,Divide and Conquer,Sorting,Counting]

https://leetcode.com/problems/majority-element/description/Given an array nums of size n, return the majority element.The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array. Example 1:Input: nums = [3,2,3]Output: 3Example 2:Input: nums = [2,2,1,1,1,2,2]Output: 2 Constraints:n == nums.length1 -109  Follow-up: C..

Coding_Practice 2024.10.10

Review 11 - Dynamic Programming

https://eglife.tistory.com/123 Review 10 - Single-Source-Shortest Path in C++https://eglife.tistory.com/103 Review 9 - MST(Minimum Spanning Trees) in C++https://eglife.tistory.com/98 [Algorithm] Review 8 - Priority Queues and Heaps in C++https://eglife.tistory.com/92 [Main course!] Review 7 - Inheritance in C++https://eglife.tiseglife.tistory.com 프로그래밍 최악의 손님 DP다. 재귀적으로 진행되는 코딩은 솔루션을 펼쳐놓고 봐도 뭔 소..

Review 6 - Python Recursion & Merge Sort

https://eglife.tistory.com/73 Review 6 - Python Search(Linear / Binary) & Sort(Selection / Insertion)https://eglife.tistory.com/72 Review 5 - Python OOP(Objected Oriented Programming)https://eglife.tistory.com/68 Review 4 - Python File I/Ohttps://eglife.tistory.com/67 Review 3 - Loop & Set,Tuple,Dictionaries,Mutabilityhttps://eglife.tistory.com/66 Reveglife.tistory.com Python에서 머리 깨지게 하는 녀석 중 하나..

SW 만학도/Python 2024.07.07