Skip to content

Added Python solution for 53. Maximum Subarray #117

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

Merged
merged 3 commits into from
Oct 15, 2022

Conversation

JoyKrishan
Copy link
Contributor

Added Python solution for 53. Maximum Subarray. #114

Copy link
Owner

@Tahanima Tahanima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File is empty

@@ -0,0 +1,10 @@
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
current_sum, max_sub_sum = 0, nums[0]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a blank line below

current_sum, max_sub_sum = 0, nums[0]
for num in nums:
if current_sum < 0:
current_sum = 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a blank line below

@Tahanima Tahanima merged commit b2d5a03 into Tahanima:main Oct 15, 2022
@JoyKrishan JoyKrishan deleted the leetcode-53 branch June 29, 2023 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants