The Number of Full Rounds You Have Played, Leetcode 1906. In this case, the first element corresponds to the peak element. Smallest String Starting From Leaf, Leetcode 989. Kth Distinct String in an Array, Leetcode 2054. Partition Array for Maximum Sum, Leetcode 1044. Find the Divisibility Array of a String, Leetcode 2576. Maximum Height by Stacking Cuboids, Leetcode 1692. Replace Elements with Greatest Element on Right Side, Leetcode 1300. Moving Stones Until Consecutive II, Leetcode 1042. Compare Strings by Frequency of the Smallest Character, Leetcode 1171. Check if Matrix Is X Matrix, Leetcode 2320. Finding the Users Active Minutes Solution, Leetcode 1820. Knight Probability in Chessboard, Leetcode 689. Minimum Operations to Make the Array K Increasing, Leetcode 2113. Queens That Can Attack the King, Leetcode 1227. Find the Substring With Maximum Cost, Leetcode 2607. Find Distance in a Binary Tree Solution, Leetcode 1742. Split Array With Same Average, Leetcode 807. Validate Binary Tree Nodes, Leetcode 1367. Minimum Total Space Wasted With K Resizing Operations, Leetcode 1960. Percentage of Letter in String, Leetcode 2279. Number of Great Partitions, Leetcode 2520. Check If a String Can Break Another String, Leetcode 1434. We can create a pointer i and set it to 0 to point to the first element. Find the Maximum Number of Marked Indices, Leetcode 2577. Count Collisions of Monkeys on a Polygon, Leetcode 2552. Based on the obtained peak index, the partition array into two parts. Minimum Insertions to Balance a Parentheses String, Leetcode 1542. You may imagine that nums[-1] = nums[n] = -. Divide Array in Sets of K Consecutive Numbers, Leetcode 1297. Longest Common Subsequence, Leetcode 1144. Minimum Number of Moves to Seat Everyone, Leetcode 2038. Maximum Tastiness of Candy Basket, Leetcode 2518. Got a question? Online Majority Element In Subarray, Leetcode 1160. Maximum Average Subarray II, Leetcode 646. Number Of Rectangles That Can Form The Largest Square Solution, Leetcode 1730. Two Sum IV - Input is a BST, Leetcode 659. Ask the Teaching Assistantanything you don't understand. Determine if Two Events Have Conflict, Leetcode 2447. Maximum Number of Coins You Can Get, Leetcode 1562. Split Array into Consecutive Subsequences, Leetcode 662. Count Elements With Strictly Smaller and Greater Elements, Leetcode 2149. Count Ways to Group Overlapping Ranges, Leetcode 2581. Add to Array-Form of Integer, Leetcode 990. Longest Arithmetic Subsequence of Given Difference, Leetcode 1221. Maximum Score of a Node Sequence, Leetcode 2243. Check if Every Row and Column Contains All Numbers, Leetcode 2134. The output will be 3. Number of Good Binary Strings, Leetcode 2534. Booking Concert Tickets in Groups, Leetcode 2287. Maximum Product Difference Between Two Pairs, Leetcode 1914. Count the Number of Beautiful Subarrays, Leetcode 2589. If the array contains multiple peaks, return the index to any of the peaks. Find the Derangement of An Array, Leetcode 636. Maximum Sum of 3 Non-Overlapping Subarrays, Leetcode 698. Peak element in an array in c - Stack Overflow Palindrome Partitioning III, Leetcode 1281. In this array, the peak element can be either 20 or 90. Complex Number Multiplication, Leetcode 538. Apply Bitwise Operations to Make Strings Equal, Leetcode 2548. Form Smallest Number From Two Digit Arrays, Leetcode 2606. Maximum Sum Circular Subarray, Leetcode 919. Count Nodes With the Highest Score, Leetcode 2052. Make the Prefix Sum Non negative, Leetcode 2600. Maximum Subsequence Score, Leetcode 2543. Maximal Score After Applying K Operations, Leetcode 2533. Sum of Nodes with Even-Valued Grandparent, Leetcode 1317. Submitthe part you don't understand to our editors. Sign of the Product of an Array Solution, Leetcode 1823. Left and Right Sum Differences, Leetcode 2575. Equal Row and Column Pairs, Leetcode 2353. Increasing Order Search Tree, Leetcode 902. 22. Shortest Path Visiting All Nodes, Leetcode 849. Find Peak element in Mountain Array or Bitonic Array Range Product Queries of Powers, Leetcode 2439. Number of Ways to Reorder Array to Get Same BST, Leetcode 1570. Kth Largest Element in a Stream, Leetcode 708. Solution to the Problem The problem can be solved using the following two approaches: Using Binary Search Using Linear Search Find Largest Value in Each Tree Row, Leetcode 516. Minimum Operations to Remove Adjacent Ones in Matrix, Leetcode 2124. Minimum Number of Days to Make m Bouquets, Leetcode 1483. Reverse Nodes in Even Length Groups, Leetcode 2076. Maximize Number of Subsequences in a String, Leetcode 2208. Peak Index in a Mountain Arrayhttps://leetcode.com/problems/peak-index-in-a-mountain-array/Binary search https://www.youtube.com/watch?v=RUl_tF. Input: 0 1 2 3 2 1 0 Output: 3 Explanation: the largest element is 3 and its index is 3. adarsh_3099. Removing Stars From a String, Leetcode 2391. Partition Array Such That Maximum Difference Is K, Leetcode 2295. Find The Original Array of Prefix Xor, Leetcode 2434. Length of Longest Fibonacci Subsequence, Leetcode 882. Minimum Lines to Represent a Line Chart, Leetcode 2281. Longest Word With All Prefixes, Leetcode 1863. Maximum Product of Splitted Binary Tree, Leetcode 1343. Minimum Cuts to Divide a Circle, Leetcode 2482. Number of Visible People in a Queue, Leetcode 1946. Sum of Beauty in the Array, Leetcode 2014. Longest Palindrome by Concatenating Two Letter Words, Leetcode 2133. Maximum White Tiles Covered by a Carpet, Leetcode 2272. We compare the current element at index i with the next element at index i + 1. Minimum Path Cost in a Hidden Grid Solution, Leetcode 1811. N-Repeated Element in Size 2N Array, Leetcode 964. For corner elements, we can consider the only neighbour present. Count Unguarded Cells in the Grid, Leetcode 2258. Number of Dice Rolls With Target Sum, Leetcode 1156. Minimum Number of Operations to Reinitialize a Permutation Solution, Leetcode 1807. Find Peak Element Medium Find in Mountain Array Hard Minimum Number of Removals to Make Mountain Array Hard If array[i] > array[i-1] and array[i] > array[i+1], then array[i] is a peak. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target, Leetcode 1547. 1 Answer Sorted by: 0 You don't initialize mid_num, which causes undefined behavior. Because the largest element in the array is 110 whose index is 3. Sentence Similarity III Solution, Leetcode 1814. Moving Stones Until Consecutive, Leetcode 1038. Path with Maximum Probability, Leetcode 1515. Number of Valid Words in a Sentence, Leetcode 2048. Minimum Sideway Jumps Solution, Leetcode 1827. Count Total Number of Colored Cells, Leetcode 2580. Maximum Value after Insertion, Leetcode 1882. Number of Burgers with No Waste of Ingredients, LeetCode 1277. Minimum Time to Collect All Apples in a Tree, Leetcode 1444. Time Needed to Rearrange a Binary String, Leetcode 2382. Maximum Sum Score of Array, Leetcode 2220. Check if There is a Valid Partition For The Array, Leetcode 2370. Minimum Number of Vertices to Reach All Nodes, Leetcode 1558. Checking Existence of Edge Length Limited Paths Solution, Leetcode 1700. Sort Even and Odd Indices Independently, Leetcode 2165. Escape the Spreading Fire, Leetcode 2259. Truncate Sentence Solution, Leetcode 1817. Restore the Array From Adjacent Pairs Solution, Leetcode 1744. Distribute Money to Maximum Children, Leetcode 2592. Number of Different Integers in a String Solution, Leetcode 1806. Number of Pairs of Interchangeable Rectangles, Leetcode 2002. Longest Word in Dictionary through Deleting, Leetcode 530. Maximum Profit in Job Scheduling, Leetcode 1237. Longest Subsequence With Limited Sum, Leetcode 2390. Minimum Interval to Include Each Query Solution, Leetcode 1852. Difference Between Element Sum and Digit Sum of an Array, Leetcode 2536. Find the Peak Element | C++ Placement Course | Lecture 29.5 Apna College 3.29M subscribers Subscribe 872 34K views 1 year ago C++ Full Course | C++ Tutorial | Data Structures & Algorithms. Construct Binary Tree from Preorder and Postorder Traversal, Leetcode 893. Minimum Remove to Make Valid Parentheses, Leetcode 1250. Merge BSTs to Create Single BST, Leetcode 1935. If we reach the end, then array is a valid mountain, otherwise, it's not. Time Taken to Cross the Door, Leetcode 2535. Maximum Sum of an Hourglass, Leetcode 2430. Detonate the Maximum Bombs, Leetcode 2102. Monotonic arrays are sorted in ascending or descending order, but in bitonic or mountain arrays some elements are in ascending order and then descending order. Move Sub-Tree of N-Ary Tree, Leetcode 1519. Maximum Profit From Trading Stocks, Leetcode 2294. Maximum Running Time of N Computers, Leetcode 2143. Find Servers That Handled Most Number of Requests, Leetcode 1610. Removing Minimum and Maximum From Array, Leetcode 2092. Destroy Sequential Targets, Leetcode 2455. Count All Valid Pickup and Delivery Options, Leetcode 1361. Step-By-Step Directions From a Binary Tree Node to Another Solution, Leetcode 2097. And we already know how to do this from Find the First True in a Sorted Boolean Array module. Split a String Into the Max Number of Unique Substrings, Leetcode 1594. Find the Peak Element in a 2D Array/Matrix - GeeksforGeeks Minimum Insertion Steps to Make a String Palindrome, Leetcode 1313. Pairs of Songs With Total Durations Divisible by 60, Leetcode 1011. A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom. Maximum Difference by Remapping a Digit, Leetcode 2567. Elements in Array After Removing and Replacing Elements, Leetcode 2114. Sum of Digits in Base K Solution, Leetcode 1838. Maximum Value of K Coins From Piles, Leetcode 2219. Counting Words With a Given Prefix, Leetcode 2186. Numbers At Most N Given Digit Set, Leetcode 903. Kth Smallest Product of Two Sorted Arrays, Leetcode 2042. Minimum XOR Sum of Two Arrays, Leetcode 1881. Insert into a Cyclic Sorted List, Leetcode 711. Cycle Length Queries in a Tree, Leetcode 2510. Substrings That Begin and End With the Same Letter, Leetcode 2085. Construct Binary Tree from String, Leetcode 537. Prime Number of Set Bits in Binary Representation, Leetcode 768. Design Movie Rental System, Leetcode 1913. Minimize Hamming Distance After Swap Operations Solution, Leetcode 1724. Find a Peak Element II - LeetCode Find Closest Node to Given Two Nodes, Leetcode 2361. Find Leaves of Binary Tree Solution, LeetCode 419. Can Make Arithmetic Progression From Sequence, Leetcode 1503. GOOGLE - FIND PEAK ELEMENT (LeetCode) - YouTube Find the Peak Element from an Array - TutorialCup Count Subarrays With Score Less Than K, Leetcode 2303. Smallest Subtree with all the Deepest Nodes, Leetcode 871. Smallest Missing Genetic Value in Each Subtree, Leetcode 2005. Delete the Middle Node of a Linked List, LeetCode 2096. Rearrange Array to Maximize Prefix Score, Leetcode 2588. Maximum of Absolute Value Expression, Leetcode 1135. Max Chunks To Make Sorted II, Leetcode 774. Sum of Mutated Array Closest to Target, Leetcode 1301. If 1 is returned then the generated output will be 1 else 0. Subarray With Elements Greater Than Varying Threshold, Leetcode 2335. Number of Steps to Reduce a Number in Binary Representation to One, Leetcode 1409. Largest Number After Mutating Substring, Leetcode 1947. Minimum Moves to Reach Target Score, Leetcode 2140. Find the City With the Smallest Number of Neighbors at a Threshold Distance, Leetcode 1335. Minimize the Difference Between Target and Chosen Elements, Leetcode 1982. Subtract the Product and Sum of Digits of an Integer, Leetcode 1282. Clone Binary Tree With Random Pointer, Leetcode 1489. Minimum Average Difference, Leetcode 2257. We need to find the feasible function that returns false for elements up until the peak and true from the peak to the end. Convert Binary Number in a Linked List to Integer, Leetcode 1292. Minimum Cost Tree From Leaf Values, Leetcode 1131. Best Time to Buy and Sell Stock with Transaction Fee, Leetcode 718. Find Resultant Array After Removing Anagrams, Leetcode 2274. Average of Levels in Binary Tree, Leetcode 644. Divide Array Into Increasing Sequences, Leetcode 1123. Process Tasks Using Servers, Leetcode 1883. Array With Elements Not Equal to Average of Neighbors, Leetcode 1969. Shortest Subarray to be Removed to Make Array Sorted, Leetcode 1577. Maximum Price to Fill a Bag, Leetcode 2549. Maximum Number of Visible Points, Leetcode 1625. Fraction Addition and Subtraction, Leetcode 594. Smallest String With Swaps, Leetcode 1203. Find Valid Matrix Given Row and Column Sums, Leetcode 1606. Design Bounded Blocking Queue, Leetcode 1189. Queries on a Permutation With Key, Leetcode 1411. Minimize Max Distance to Gas Station, Leetcode 775. Intersection of Three Sorted Arrays, LeetCode 1218. Build Array from Permutation, Leetcode 1921. Minimize Rounding Error to Meet Target, Leetcode 1059. Categorize Box According to Criteria, Leetcode 2526. Angle Between Hands of a Clock, Leetcode 1347. Minimum Number of Visited Cells in a Grid, Find the First True in a Sorted Boolean Array, has an element with the largest value called "peak", with index. Tiling a Rectangle with the Fewest Squares, Leetcode 1247. Maximum Number of Books You Can Take, Leetcode 2357. Split Message Based on Limit, Leetcode 2470. Maximum Twin Sum of a Linked List, Leetcode 2131. Calculate Money in Leetcode Bank Solution, Leetcode 1717. Sum Of Special Evenly-Spaced Elements In Array Solution, Leetcode 1716. Maximum Number of Events That Can Be Attended, Leetcode 1354. Maximum Earnings From Taxi, Leetcode 2009. Reverse Subarray To Maximize Array Value, Leetcode 1331. Binary Searchable Numbers in an Unsorted Array, Leetcode 1968. Partition Array According to Given Pivot, Leetcode 2162. Maximum Rows Covered by Columns, Leetcode 2398. Bitwise XOR of All Pairings, Leetcode 2426. Peak Element in 2D array - Online Tutorials Library Minimum Absolute Difference, Leetcode 1202. Eliminate Maximum Number of Monsters, Leetcode 1926. Find the Longest Balanced Substring of a Binary String, Leetcode 2610. Check if an Array Is Consecutive, Leetcode 2231. Determine if String Halves Are Alike Solution, Leetcode 1705. Cells with Odd Values in a Matrix, Leetcode 1253. Rearrange Characters to Make Target String, Leetcode 2289. For this problem, we will consider some bounds. Second Minimum Time to Reach Destination, Leetcode 2046. We can pad the array with an imaginary node of negative infinity. Longest Common Subsequence Between Sorted Arrays, Leetcode 1942. Minimum Sum of Squared Difference, Leetcode 2334. Count the Number of Good Subarrays, Leetcode 2539. Root Equals Sum of Children, Leetcode 2237. In an array, an element is a peak element, if the element is greater than both the neighbours. Successful Pairs of Spells and Potions, Leetcode 2301. Number of Smooth Descent Periods of a Stock, Leetcode 2111. Minimum Number of Increments on Subarrays to Form a Target Array, Leetcode 1530. Maximum Alternating Subsequence Sum, Leetcode 1912. Minimum Deletions to Make Array Beautiful, Leetcode 2217. Find Positive Integer Solution for a Given Equation, Leetcode 1238. Preimage Size of Factorial Zeroes Function, Leetcode 795. Removing Minimum Number of Magic Beans, Leetcode 2174. Minimum Distance Between BST Nodes, Leetcode 786. Minimum Moves to Reach Target with Rotations, Leetcode 1213. Maximum Enemy Forts That Can Be Captured, Leetcode 2515. Lowest Common Ancestor of a Binary Tree IV, Leetcode 1682. K Divisible Elements Subarrays, Leetcode 2263. Minimum Garden Perimeter to Collect Enough Apples, Leetcode 1955. Maximum Ascending Subarray Sum Solution, Leetcode 1801. Max Sum of a Pair With Equal Sum of Digits, Leetcode 2343. This video shows how to solve the problem Peak index in a mountain array. Maximum Path Quality of a Graph, Leetcode 2067. Minimum Domino Rotations For Equal Row, Leetcode 1008. Convert BST to Greater Tree, Leetcode 540. Find Original Array From Doubled Array, Leetcode 2008. Maximum Length of Repeated Subarray, Leetcode 719. Minimum Operations to Make a Subsequence Solution, Leetcode 1714. because the neighbors of both the elements (10, 15 in case of 20 and 23, 67 in case of 90) are smaller than the element itself. Path With Maximum Minimum Value, Leetcode 1103. Total Cost to Hire K Workers, Leetcode 2464. Maximum Star Sum of a Graph, Leetcode 2499. An item is said to be a peak element when it is greater than or equal with all four neighbor of that element. Find Winner on a Tic Tac Toe Game, Leetcode 1276. Remove Colored Pieces if Both Neighbors are the Same Color, Leetcode 2039. Count Pairs With XOR in a Range Solution, Leetcode 1805. Maximum Difference Between Increasing Elements, Leetcode 2018. Shortest Distance to Target String in a Circular Array, Leetcode 2516. Count Number of Special Subsequences, Leetcode 1959. Remove All Ones With Row and Column Flips Solution, Leetcode 2130. First Day Where You Have Been in All the Rooms, Leetcode 1999. Maximum Value of a String in an Array, Leetcode 2497. Count the Digits That Divide a Number, Leetcode 2521. Frequency of the Most Frequent Element Solution, Leetcode 1839. Calculate Digit Sum of a String, Leetcode 2244. Minimum Swaps to Make Strings Equal, Leetcode 1248. Maximum Matching of Players With Trainers, Leetcode 2411. Minimum Operations to Make Array Equal, Leetcode 1552. Use These Resources-----(NEW) My Data Structures & Algorithms for Coding Interviews. Find All Possible Recipes from Given Supplies, Leetcode 2116. Minimum Fuel Cost to Report to the Capital, Leetcode 2478. Kth Missing Positive Number, Leetcode 1540. Find the index of the peak element. Create Components With Same Value, Leetcode 2441. Just find peak element - Find in Mountain Array - LeetCode Most Stones Removed with Same Row or Column, Leetcode 949. Remove Duplicates From an Unsorted Linked List Solution, Leetcode 1837. Element Appearing More Than 25% In Sorted Array, Leetcode 1289. Best Position for a Service Centre, Leetcode 1516. Amount of New Area Painted Each Day Solution, Leetcode 2160. Peak Index in a Mountain Array - TutorialCup Maximum Difference Between Node and Ancestor, Leetcode 1027. Inorder Successor in BST II, Leetcode 513. Intervals Between Identical Elements, Leetcode 2122. Peak Index of Mountain Array Problem in Java - javatpoint The opposite of this statement can be used to find when we reach a valley. Maximum Number of Balls in a Box Solution, Leetcode 1743. Maximum Trailing Zeros in a Cornered Path, Leetcode 2246. Check if the Sentence Is Pangram Solution, Leetcode 1833. Find the Longest Substring Containing Vowels in Even Counts, Leetcode 1372. Smallest K Length Subsequence With Occurrences of a Letter, Leetcode 2031. Minimum Number of Operations to Convert Time, Leetcode 2225. Given a 0-indexed integer array nums, find a peak element, and return its index. Check if a Parentheses String Can Be Valid, Leetcode 2117. Sort Linked List Already Sorted Using Absolute Values, Leetcode 2047. Minimum Swaps to Group All 1's Together, Leetcode 1153. Find All Groups of Farmland, Leetcode 1994. Minimum Cost to Separate Sentence Into Rows, Leetcode 2053. N-ary Tree Preorder Traversal, Leetcode 590. Find Numbers with Even Number of Digits, Leetcode 1296. Distinct Numbers in Each Subarray Solution, Leetcode 1853. Binary Tree Longest Consecutive Sequence II, Leetcode 551. Minimum Operations to Make All Array Elements Equal, Leetcode 2604. Smallest Subarrays With Maximum Bitwise OR, Leetcode 2412. Maximum Number of Words You Can Type, Leetcode 1936. Longest Square Streak in an Array, Leetcode 2503. Shortest Common Supersequence, Leetcode 1093. Monotonic arrays are sorted in ascending or descending order, but in bitonic or mountain arrays some elements are in ascending order and then descending order. Strictly Palindromic Number, Leetcode 2397. Longest Subarray With Maximum Bitwise AND, Leetcode 2422. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold, Leetcode 1344. Minimum ASCII Delete Sum for Two Strings, Leetcode 713. Insufficient Nodes in Root to Leaf Paths, Leetcode 1081. Maximum Count of Positive Integer and Negative Integer, Leetcode 2530. K Highest Ranked Items Within a Price Range, Leetcode 2147. Minimum Amount of Time to Fill Cups, Leetcode 2336. Swap For Longest Repeated Character Substring, Leetcode 1157. Minimum Cost to Reach Destination in Time, Leetcode 1930. Count Servers that Communicate, Leetcode 1269. Find Palindrome With Fixed Length, Leetcode 2218. Maximum Alternating Subarray Sum, Leetcode 2037. Maximize Total Tastiness of Purchased Fruits, Leetcode 2432. For example, for input array {5, 10, 20, 15}, 20 is the only peak element. Append K Integers With Minimal Sum, Leetcode 2196. Maximum Score From Removing Substrings Solution, Leetcode 1719. Number of Ways to Split Array, Leetcode 2271. Minimum Score After Removals on a Tree, Leetcode 2323. Remove Letter To Equalize Frequency, Leetcode 2425. Average Value of Even Numbers That Are Divisible by Three, Leetcode 2456. algorithm - How to find a peak in an array? - Stack Overflow Count Prefixes of a Given String, Leetcode 2256. Search for an element in a Mountain Array - GeeksforGeeks Maximum Number of Occurrences of a Substring, Leetcode 1298. Last Moment Before All Ants Fall Out of a Plank, Leetcode 1504. Reconstruct a 2-Row Binary Matrix, Leetcode 1255. Minimum Difference in Sums After Removal of Elements, Leetcode 2164. Adding Spaces to a String, Leetcode 2110. Example 1: Maximum Depth of N-ary Tree, Leetcode 562. Peak Index in a Mountain Array - LeetCode Checking Existence of Edge Length Limited Paths II Solution, Leetcode 1725. Longer Contiguous Segments of Ones than Zeros, Leetcode 1870. Assume there is only one peak element. Given a 0-indexed m x n matrix mat where no two adjacent cells are equal, find any peak element mat [i] [j] and return the length 2 array [i,j]. Find the K Beauty of a Number, Leetcode 2270. Add Edges to Make Degrees of All Nodes Even, Leetcode 2509. Largest Component Size by Common Factor, Leetcode 953. < arr [i - 1] < arr [i] Minimum Cost to Hire K Workers, Leetcode 861. Flip Columns For Maximum Number of Equal Rows, Leetcode 1073. Number of Subarrays Having Even Product, Leetcode 2496. Find the middle element of the array A. Maximum Sum Obtained of Any Permutation, Leetcode 1592. If peak is present at some middle element, we run another loop from that position to check strictly decreasing order or elements. Minimum Reverse Operations, Leetcode 2616. Subarray Sums Divisible by K, Leetcode 979. Valid Arrangement of Pairs, Leetcode 2098. Number of Ships in a Rectangle, Leetcode 1275. Process Restricted Friend Requests, Leetcode 2083. Find Elements in a Contaminated Binary Tree, Leetcode 1262. Maximum Distance Between a Pair of Values Solution, Leetcode 1856. All Nodes Distance K in Binary Tree, Leetcode 864. Change Minimum Characters to Satisfy One of Three Conditions Solution, Leetcode 1738. Number of Distinct Roll Sequences, Leetcode 2319. Peak Index in a Mountain Array; Solution 1 - Linear scan. Number of Wonderful Substrings, Leetcode 1920. In the implementation, we don't actually need to pad the array as that would incur O(n) extra cost. Minimum Path Cost in a Grid, Leetcode 2305. Sender With Largest Word Count, Leetcode 2285. Optimize Water Distribution in a Village, Leetcode 1170. K Items With the Maximum Sum, Leetcode 2601. Widest Pair of Indices With Equal Range Sum, Leetcode 1985. Partition Array Into Two Arrays to Minimize Sum Difference, Leetcode 2036. Maximum Compatibility Score Sum, Leetcode 1948. Longest Uncommon Subsequence II, Leetcode 524. Maximum Width of Binary Tree, Leetcode 668. If the middle element is on the descending sequence of elements (A [mid] > A [mid+1]), then it means that the peak element will be on the left side of this middle element. Length of the Longest Alphabetical Continuous Substring, Leetcode 2415. All Paths From Source to Target, Leetcode 798. Prereq: Vanilla Binary Search and Finding the Boundary with Binary Search, A mountain array is defined as an array that. Get Biggest Three Rhombus Sums in a Grid, Leetcode 1879. Largest 3 Same Digit Number in String, Leetcode 2265. Find in Mountain Array Hard 2.1K 80 Companies (This problem is an interactive problem.) Design a Stack With Increment Operation, Leetcode 1382. A peak element is an element that is strictly greater than its neighbors.