We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4270101 commit 7cbb4bfCopy full SHA for 7cbb4bf
docs/max_sum_sub_array.md
@@ -4,6 +4,7 @@
4
5
### It maintains the maximum sum seen so far and runs in O(n) time with O(1) space.
6
7
+```python
8
# Function to find the subarray with the maximum sum
9
fn max_sum_sub_array(nums: List[Int]) -> Int:
10
# If the list is empty, return 0 as no subarray exists
@@ -32,3 +33,5 @@ def main():
32
33
nums = List(5,4,-1,7,8)
34
max_sum = max_sum_sub_array(nums)
35
debug_assert(max_sum == 23, "Assertion failed")
36
+```
37
+[Source](https://github.com/ratulb/mojo_programming/blob/main/codes/max_sum_sub_array.mojo)
0 commit comments