Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Find in Mountain Array
Bookmark
Linear Scan
Find Peak + Two Binary Searches
Optimized with Caching
Input
Found in descending
Found in ascending
Not found
Small mountain
Both halves
Minimum mountain
Custom
arr
=
[1, 3, 5, 7, 6, 4, 2]
,
target
=
6
0
1
1
3
2
5
3
7
4
6
5
4
6
2
0
1
1
3
2
5
3
7
4
6
5
4
6
2
0
1
1
3
2
5
3
7
4
6
5
4
6
2
i
0
1
1
3
2
5
3
7
4
6
5
4
6
2
i
0
1
1
3
2
5
3
7
4
6
5
4
6
2
i
0
1
1
3
2
5
3
7
4
6
5
4
6
2
i
0
1
1
3
2
5
3
7
4
6
5
4
6
2
i
0
1
1
3
2
5
3
7
4
6
5
4
6
2
found
algo
master
.
io
Step:
Start: find target 6 in the mountain array
0 / 6
Input
Found in descending
Found in ascending
Not found
Small mountain
Both halves
Minimum mountain
Custom
arr
=
[1, 3, 5, 7, 6, 4, 2]
,
target
=
6
0 / 6
algo
master
.
io
Step:
Start: find target 6 in the mountain array