SarthakKeshari / Java-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
46 stars 95 forks source link

Kadane's Algo #357

Closed RAshid602 closed 2 years ago

RAshid602 commented 2 years ago

Issue Id you have worked upon -

352

Briefly explain your program logic -

Here we will be given array an we have to find max sub Array i).We will add the subArray and store in CurrentSum. ii).If CurrentSum is greater than MaxSum update MaxSum, iii).If CurrentSum is less than zero(negative) discard the sum.i.e.CurrentSum=0; iv).Return the MaxSum.

Screenshots(Attach 2 screenshots of your own input and output) -

kadane ans1 kadane ans2

Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -

RAshid602 commented 2 years ago

I think its done. let me know if there anything to change.

SarthakKeshari commented 2 years ago

@RAshid602, Kindly re-commit your files. Its showing two files, which in turn is trying to delete another file in the repository.

RAshid602 commented 2 years ago

@RAshid602, Kindly re-commit your files. Its showing two files, which in turn is trying to delete another file in the repository.

Can you delete replace.java file, I think after than it will be resolved.

ravi0213 commented 2 years ago

@RAshid602 here is the easiest way to do this.

First, revert your last commit which deletes the file with `git revert HEAD~1`
then recommit without deleting it.

If it is not the last commit that deletes the file then change HEAD~1 with that commit hash.

RAshid602 commented 2 years ago

I am not been able to do that Can I generate a new issue with same question. i will be able to push that one easily.👀

SarthakKeshari commented 2 years ago

I am not been able to do that Can I generate a new issue with same question. i will be able to push that one easily.👀

Ok if that is the case. Create a PR then. You may close this one, once you have read this comment.