Perfect squares is a DP problem through and through.. all the solutions in Dicuss use DP.
I came up with a BFS solution for this problem and it is always TLE. I checked using a different online C++ platform if my code works and it passes the test case I get on TLE, so clearly leetcode wants the DP way. Why is this problem here?
Anyone have a BFS solution that leetcode actually accepts?