Skip to content

Commit 2e96e1d

Browse files
committed
724. Find Pivot Index
1 parent 8922ade commit 2e96e1d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Algorithms/Techniques/Prefix Sum/LeetCode/Array/724. Find Pivot Index.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def pivotIndex_optimized(self, nums) -> int:
2929
iterate through the array. If the sum from the left matches the sum from the right we send the value of left as
3030
the pivot index. In each loop we subtract the right sie first and then check the condition, if the condition is
3131
not true we increment left_sum.
32+
33+
Time Complexity: O(n), Space Complexity: O(1)
3234
:param nums:
3335
:return: left (pivot)
3436
"""

0 commit comments

Comments
 (0)