Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2698. Find the Punishment Number of an Integer
Sum the squares i^2 for all i in [1..n] such that the decimal digits of i^2 can be partitioned into contiguous substrings whose integer values add up to i. This is solved by testing each i with a DFS/backtracking over digit partitions (n ≤ 1000, i^2 has at most a few digits so pruning suffices).
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.