Eat Study Love

먹고 공부하고 사랑하라

코테준비 34

Kth Largest Element in a Stream[E,Tree,Design,Binary Search Tree,Heap (Priority Queue),Binary Tree,Data Stream]

https://leetcode.com/problems/kth-largest-element-in-a-stream/description/?envType=daily-question&envId=2024-08-12Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.Implement KthLargest class:KthLargest(int k, int[] nums) Initializes the object with the integer k and the stream of integers nums.int..

Coding_Practice 2024.08.12

Kth Distinct String in an Array[E,Array,Hash Table,String,Counting]

https://leetcode.com/problems/kth-distinct-string-in-an-array/description/?envType=daily-question&envId=2024-08-05A distinct string is a string that is present only once in an array.Given an array of strings arr, and an integer k, return the kth distinct string present in arr. If there are fewer than k distinct strings, return an empty string "".Note that the strings are considered in the order ..

Coding_Practice 2024.08.05

Make Two Arrays Equal by Reversing Subarrays[E,Array,Hash Table,Sorting]

https://leetcode.com/problems/make-two-arrays-equal-by-reversing-subarrays/description/?envType=daily-question&envId=2024-08-03You are given two integer arrays of equal length target and arr. In one step, you can select any non-empty subarray of arr and reverse it. You are allowed to make any number of steps.Return true if you can make arr equal to target or false otherwise. Example 1:Input: tar..

카테고리 없음 2024.08.03

Binary Tree Inorder Traversal[E,Stack,Tree,Depth-First Search,Binary Tree]

https://leetcode.com/problems/binary-tree-inorder-traversal/description/Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1:Input: root = [1,null,2,3]Output: [1,3,2]Example 2:Input: root = []Output: []Example 3:Input: root = [1]Output: [1] Constraints:The number of nodes in the tree is in the range [0, 100].-100 굉장히 기초적인 것이라고 생각했던 부분들인데 모르겠다아 짜증난다.. 1. P..

Coding_Practice 2024.07.31

Design HashMap[E,Array,Hash Table,Linked List,Design,Hash Function]

https://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 the value to which the s..

Coding_Practice 2024.07.26