companyhub
DashboardCompaniesProblemsSheetsBookmarksRevisionsAnalyticsLeaderboardCompare
Settings
Sign in
DashboardCompaniesProblemsSheetsBookmarks
Medium

Find K Closest Elements

49.7% acceptance · asked by 19 companies

Solve on LeetCode
ArraySliding WindowBinary SearchTwo PointersSortingHeap (Priority Queue)

Workspace

Scratch, run, iterate — then submit on LeetCode

Custom input (stdin)

Console

Output appears here. Runs on the free Piston sandbox.

Your notes

Sign in to keep markdown notes on this problem — approach, complexity, gotchas.

Who asks this

Cashfree88Yandex88Coupang75Doordash63Amazon
50
Apple50
Flipkart50
Linkedin50
Meta50
Infosys38
Bloomberg38
Tiktok38
Google38
Atlassian38
Microsoft38
Nvidia38
Uber25
Tcs25
Salesforce25

Related problems

Two Sum
Easy
Merge Intervals
Medium
Best Time to Buy and Sell Stock
Easy
Group Anagrams
Medium
Number of Islands
Medium