Search
⌘K
Get Premium
Leetcode 991. Broken Calculator
Given startValue and target, compute the minimum operations to reach target using multiply-by-2 and minus-1; the optimal approach is to work backwards from target applying inverse operations (if target is even divide by 2, if odd add 1) until it drops to or below start, then finish by taking the remaining differences.
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.