Рет қаралды 42,790
This video explains an important programming interview problem which is to find the minimum number of sqaures which can be added to form a given
number N.We can solve this problem by various methods but the simple recursive method will take exponential time.I have shown 3 methods to solve
this problem.The first method is by using recursion with memoization to remove unnecessary recursion calls.The second method is by using Dynamic Programming tabulation method.The third method is based on Legendre's 3-square theorem.This method gives the best time complexity of just O(sqrt(N)).At the end of the video, i have shown the code walk-through.
CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
=================================================================
INSTAGRAM: / surya.pratap.k
LinkedIn: / surya-pratap-kahar-47b...
WEBSITE: techdose.co.in/
=================================================================
CODE LINK: gist.github.co...