Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat : Enhance MinimumPathSum implemtation in DP section #4395

Closed
Manan-09 opened this issue Sep 23, 2023 · 2 comments · Fixed by #4400
Closed

Feat : Enhance MinimumPathSum implemtation in DP section #4395

Manan-09 opened this issue Sep 23, 2023 · 2 comments · Fixed by #4400
Assignees

Comments

@Manan-09
Copy link
Contributor

What would you like to Propose?

We can optimise space complexity of MinimumPathSum from O(n*m) to O(min(n,m)

Also we can move testcases to seperate test file

Issue details

  • Current implementation is not with optimum space complexity
  • Test cases are also added in same file

Additional Information

No response

@m-Chetan
Copy link

m-Chetan commented Sep 24, 2023

Can we do the modification in the input array only to get the results?
If yes then we don't need any extra space.

@siriak
Copy link
Member

siriak commented Sep 24, 2023

It's a bad practice to mutate method arguments, so I advice against doing that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants