New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
TikTok
Coding Question
AI Insights
Quick Summary
Find the smallest positive integer decrement `x` to bring all positive scores to zero or below.
You are limited to a maximum of `k` total subtraction operations across all elements.
Return `-1` if impossible, `1` if already valid, otherwise the minimal feasible `x`.
What This Tests
Monotonicity of feasibility conditions
Binary search on numerical answers
Efficient mathematical validation logic
Edge case and boundary handling
Common Patterns
Binary Search on Answer
Greedy
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected