Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2517. Maximum Tastiness of Candy Basket
Given an array of candy prices, pick k distinct candies to maximize the minimum pairwise absolute difference (the "tastiness"). With n up to 1e5, the typical approach is to sort the prices and use binary search on the tastiness value with a greedy check to see if you can pick k prices spaced at least that far apart.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.