Count total number of ways to cover the distance with 1, 2 and 3 steps.
Recursion solution time complexity is exponential i.e. O(3n).
Since same sub problems are solved again, this problem has overlapping sub problems property. So min square sum problem has both properties of a dynamic programming problem.