Interview Round DistributionClick any round below to filter
Topics:
Showing 20 of 97 results for BlackBuckPage 1 of 5
Coding
46
Unique Combinations that Sum to a Target
Find all unique combinations in an array that sum to a target.
Input: candidates = [2,4,6], target = 6
Output: [[2,2,2], [2,4], [6]]
Explanation: Uses backtracking to find all valid combinations that sum to 6, allowing for explicitly repeated elements.
Find the shortest distance from all buildings to an empty land in a grid.
You are given a grid of values 0, 1, or 2, where 0 is empty land, 1 is a building, and 2 is an obstacle. Find the shortest travel distance from all buildings to an empty land spot.
Input: grid = [[1,0],[0,1]]
Output: 2
Explanation: The empty lands are at (0,1) a…
Find the K closest points to the origin.
Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0).
Input: points = [[3,3],[5,-1],[-2,4]], k = 2
Output: [[3,3], [-2,4]]
Explanation: The squared distances are 18, 26, and 20 respectively. Th…
Find the median of two sorted arrays.
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)).
Input: nums1 = [1, 2], nums2 = [3, 4]
Output: 2.5
Explanation: The merged array is [1, 2, 3, 4]. The median is the average of th…
Top K Frequent Elements
Find the top K frequent elements in an array.
Input: nums = [4,4,4,4,5,5,6], k = 1
Output: [4]
Explanation: The number 4 appears four times, easily making it the single most frequent element in the data structure.