Eat Study Love

먹고 공부하고 사랑하라

C++ 147

Find K-th Smallest Pair Distance[H,Array,Two Pointers,Binary Search,Sorting]

https://leetcode.com/problems/find-k-th-smallest-pair-distance/description/?envType=daily-question&envId=2024-08-14The distance of a pair of integers a and b is defined as the absolute difference between a and b.Given an integer array nums and an integer k, return the kth smallest distance among all the pairs nums[i] and nums[j] where 0  Example 1:Input: nums = [1,3,1], k = 1Output: 0Explanation..

Coding_Practice 2024.08.14

Median of Two Sorted Arrays[H,Array,Binary Search,Divide and Conquer]

https://leetcode.com/problems/median-of-two-sorted-arrays/description/Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.The overall run time complexity should be O(log (m+n)). Example 1:Input: nums1 = [1,3], nums2 = [2]Output: 2.00000Explanation: merged array = [1,2,3] and median is 2.Example 2:Input: nums1 = [1,2], nums2 = [3,4]Outp..

Coding_Practice 2024.08.12

Minimum Index Sum of Two Lists[E,Array,Hash Table,String]

https://leetcode.com/problems/minimum-index-sum-of-two-lists/description/Given two arrays of strings list1 and list2, find the common strings with the least index sum.A common string is a string that appeared in both list1 and list2.A common string with the least index sum is a common string such that if it appeared at list1[i] and list2[j] then i + j should be the minimum value among all the ot..

Coding_Practice 2024.08.12

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