[99클럽 코테 스터디 11일차 TIL] LeetCode 706. Design HashMap 해설 및 풀이 (Java)
·
Study/코딩 테스트
706. Design HashMaphttps://leetcode.com/problems/design-hashmap/description/ Design a HashMap without using any built-in hash table libraries. Implement the MyHashMap class: MyHashMap() initializes the object with an empty map. void put(int key, int value) inserts a (key, value) pair into the HashMap. If the key already exists in the map, update the corresponding value. int get(int key) returns ..
[LeetCode] LeetCode 1679. Max Number of K-Sum Pairs 해설 및 풀이 (Python)
·
Study/코딩 테스트
LeetCode 1679. Max Number of K-Sum Pairshttps://leetcode.com/problems/max-number-of-k-sum-pairs/description/?envType=study-plan-v2&envId=leetcode-75 You are given an integer array nums and an integer k. In one operation, you can pick two numbers from the array whose sum equals k and remove them from the array. Return the maximum number of operations you can perform on the array.   Example 1: Inp..
[LeetCode] 11. Container With Most Water 해설 및 풀이 (Python)
·
Study/코딩 테스트
LeetCode 11. Container With Most Waterhttps://leetcode.com/problems/container-with-most-water/description/?envType=study-plan-v2&envId=leetcode-75 You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container conta..
[LeetCode] 1004. Max Consecutive Ones III 해설 및 풀이 (Python)
·
Study/코딩 테스트
LeetCode 1004. Max Consecutive Ones IIIhttps://leetcode.com/problems/max-consecutive-ones-iii/description/?envType=study-plan-v2&envId=leetcode-75 Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's.Example 1: Input: nums = [1,1,1,0,0,0,1,1,1,1,0], k = 2 Output: 6 Explanation: [1,1,1,0,0,1,1,1,1,1,1] Bolded numbers w..
[99클럽 코테 스터디 8일차 TIL] LeetCode 70. Climbing Stairs 해설 및 풀이 (Java)
·
Study/코딩 테스트
99클럽 코딩 스터디 8일차 TILLeetCode 70. Climbing Stairshttps://leetcode.com/problems/climbing-stairs/description/ You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?   Example 1: Input: n = 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 step 2. 2 steps Example 2: ..