All Posts

Leetcode 215: Kth Largest Element in an Array

Given an array of integers, find the kth largest element without sorting the entire array.

Leetcode 324: Wiggle Sort II

You are given an array of integers. Your task is to reorder the array such that the elements alternate between smaller and larger numbers. The sequence should follow the pattern nums[0] < nums[1] > nums[2] < nums[3] > nums[4]….

Leetcode 347: Top K Frequent Elements

Given an integer array nums and an integer k, return the k most frequent elements from the array. The answer may be returned in any order.

Leetcode 973: K Closest Points to Origin

Given an array of points on a 2D plane, find the k closest points to the origin (0, 0) based on Euclidean distance. If multiple points have the same distance, any order is acceptable.

Leetcode 1738: Find Kth Largest XOR Coordinate Value

You are given a 2D matrix of size m x n, consisting of non-negative integers. You are also given an integer k. The value of coordinate (a, b) in the matrix is the XOR of all the values from matrix[0][0] to matrix[a][b] (inclusive), where 0 <= a < m and 0 <= b < n (0-indexed). Your task is to find the kth largest value (1-indexed) among all the XOR values of matrix coordinates.

Leetcode 1985: Find the Kth Largest Integer in the Array

You are given an array of strings nums, where each string represents a non-negative integer. You need to find the kth largest integer in the array. Note that duplicates should be considered distinctly. For example, if the array is [‘1’, ‘2’, ‘2’], the first largest integer is ‘2’, the second largest is also ‘2’, and the third largest is ‘1’.