Number of Sublists With Small Left Value
Given a list of integers nums, return the number of sublists where the first element is not bigger than other numbers in the sublist.
Constraints
0 ≤ n ≤ 100,000wherenis the length ofnums
https://binarysearch.com/problems/Number-of-Sublists-With-Small-Left-Value
Examples
Example 1
Input
- nums =
[1, 3, 5, 2]
Output
- answer =
8
Explanation
We have the following sublists which meet the criteria:
[1][1, 3][1, 3, 5][1, 3, 5, 2][3][3, 5][5][2]
Leave a comment