Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- Absolute Difference Between Maximum and Minimum K Elements
Coding
- All the Pairs With the Maximum Number of Common Followers
Coding
- Average Salary Excluding the Minimum and Maximum Salary
Coding
- Binary Tree Maximum Path Sum
Coding · Binary Tree · Depth-First Search · DP on Trees
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2517. Maximum Tastiness of Candy Basket
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source