Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Find Pivot Index
Bookmark
Brute Force
Prefix Sum
Input
Classic
Pivot at Start
No Pivot
All Ones
Custom
nums
=
[1, 7, 3, 6, 5, 6]
0
1
2
3
4
5
1
7
3
6
5
6
0
1
2
3
4
5
1
7
3
6
5
6
0
1
2
3
4
5
1
7
3
6
5
6
i
j
rightSum =
10
0
1
2
3
4
5
1
7
3
6
5
6
i
leftSum
0
≠
rightSum
27
0
1
2
3
4
5
1
7
3
6
5
6
i
j
rightSum =
3
0
1
2
3
4
5
1
7
3
6
5
6
i
j
rightSum =
20
0
1
2
3
4
5
1
7
3
6
5
6
i
j
leftSum =
8
0
1
2
3
4
5
1
7
3
6
5
6
i
j
rightSum =
17
0
1
2
3
4
5
1
7
3
6
5
6
i
j
leftSum =
1
0
1
2
3
4
5
1
7
3
6
5
6
i
j
rightSum =
11
0
1
2
3
4
5
1
7
3
6
5
6
i
Pivot index =
3
algo
master
.
io
Step:
Start: test each index as the pivot by summing both sides from scratch
0 / 30
Input
Classic
Pivot at Start
No Pivot
All Ones
Custom
nums
=
[1, 7, 3, 6, 5, 6]
0 / 30
algo
master
.
io
Step:
Start: test each index as the pivot by summing both sides from scratch