Commit Graph

1 Commits

Author SHA1 Message Date
JatinR05
8fd06efe22
Create minimums_squares_to_represent_a_number.py (#7595)
* Create minimums_squares_to_represent_a_number.py

added a dynamic programming approach of finding the minimum number of square to represent a number.
eg : 
25 = 5*5
37 = 6*6 + 1*1
21 = 4*4 + 2*2 + 1*1

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update and rename minimums_squares_to_represent_a_number.py to minimum_squares_to_represent_a_number.py

updated the code

* Update minimum_squares_to_represent_a_number.py

I have added the appropriate checks for 0 and 12.34. 
It would be great if you could suggest a name for the dp array

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update minimum_squares_to_represent_a_number.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update minimum_squares_to_represent_a_number.py

updated

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update minimum_squares_to_represent_a_number.py

updated

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-26 16:43:01 +02:00