Back to QuestionsPractice with This Question
Perfect Squares
56.5K views•Asked 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.