Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1954. Minimum Garden Perimeter to Collect Enough Apples
Given apples at each integer point (i, j) equal to |i|+|j|, find the smallest axis-aligned square centered at the origin whose contained lattice points sum to at least neededApples; this reduces to deriving a closed-form formula for the total apples inside a square of half-side k and binary-searching the minimal k (perimeter = 8·k) under large (≤1e15) inputs.
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.