Back to Questions

Perfect Squares

56.5K viewsAsked at Airbnb
Medium

Question Explain

Given a positive integer $n$, find the least number of perfect square numbers (e.g., 1, 4, 9, 16, ...) which sum up to $n$. Use BFS or DP.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question