You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Leetcode-2873](https://leetcode.com/problems/maximum-value-of-an-ordered-triplet-i/)| Maximum Value Of An Ordered Triplet I |[c++](./leetcode/2873.maximum-value-of-an-ordered-triplet-i.cpp), [python3](./leetcode/2873.maximum-value-of-an-ordered-triplet-i.py)| Dynamic Programming | O\(N\)| O\(1\)| - |
365
+
|[Leetcode-2874](https://leetcode.com/problems/maximum-value-of-an-ordered-triplet-ii/)| Maximum Value Of An Ordered Triplet II |[c++](./leetcode/2874.maximum-value-of-an-ordered-triplet-ii.cpp), [python3](./leetcode/2874.maximum-value-of-an-ordered-triplet-ii.py)| Dynamic Programming | O\(N\)| O\(1\)| - |
|[Leetcode-1888](https://leetcode.com/problems/minimum-number-of-flips-to-make-the-binary-string-alternating/)| Minimum Number Of Flips To Make The Binary String Alternating |[c++](./leetcode/1888.minimum-number-of-flips-to-make-the-binary-string-alternating.cpp), [python3](./leetcode/1888.minimum-number-of-flips-to-make-the-binary-string-alternating.py)| Dynamic Programming | O\(N\)| O\(1\)| - |
|[Leetcode-863](https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/)| All Nodes Distance K In Binary Tree |[c++](./leetcode/863.all-nodes-distance-k-in-binary-tree.cpp), [python3](./leetcode/863.all-nodes-distance-k-in-binary-tree.py)| Hash Table | O\(N\)| O\(N\)| - |
|[Leetcode-2364](https://leetcode.com/problems/count-number-of-bad-pairs/)| Count Number Of Bad Pairs |[c++](./leetcode/2364.count-number-of-bad-pairs.cpp), [python3](./leetcode/2364.count-number-of-bad-pairs.py)| Hash Table | O\(N\)| O\(N\)| - |
524
526
|[Leetcode-3306](https://leetcode.com/problems/count-of-substrings-containing-every-vowel-and-k-consonants-ii/)| Count Of Substrings Containing Every Vowel And K Consonants II |[c++](./leetcode/3306.count-of-substrings-containing-every-vowel-and-k-consonants-ii.cpp), [python3](./leetcode/3306.count-of-substrings-containing-every-vowel-and-k-consonants-ii.py)| Hash Table | O\(N\)| O\(N\)| - |
527
+
|[Leetcode-3298](https://leetcode.com/problems/count-substrings-that-can-be-rearranged-to-contain-a-string-ii/)| Count Substrings That Can Be Rearranged To Contain A String II |[c++](./leetcode/3298.count-substrings-that-can-be-rearranged-to-contain-a-string-ii.cpp), [python3](./leetcode/3298.count-substrings-that-can-be-rearranged-to-contain-a-string-ii.py)| Hash Table | O\(N\)| O\(M\)| - |
525
528
|[Leetcode-3325](https://leetcode.com/problems/count-substrings-with-k-frequency-characters-i/)| Count Substrings With K Frequency Characters I |[c++](./leetcode/3325.count-substrings-with-k-frequency-characters-i.cpp), [python3](./leetcode/3325.count-substrings-with-k-frequency-characters-i.py)| Hash Table | O\(N\)| O\(N\)| - |
529
+
|[Leetcode-2537](https://leetcode.com/problems/count-the-number-of-good-subarrays/)| Count The Number Of Good Subarrays |[c++](./leetcode/2537.count-the-number-of-good-subarrays.cpp), [python3](./leetcode/2537.count-the-number-of-good-subarrays.py)| Hash Table | O\(N\)| O\(N\)| - |
526
530
|[Leetcode-697](https://leetcode.com/problems/degree-of-an-array/)| Degree Of An Array |[c++](./leetcode/697.degree-of-an-array.cpp), [python3](./leetcode/697.degree-of-an-array.py)| Hash Table | O\(N\)| O\(N\)| - |
|[Leetcode-3306](https://leetcode.com/problems/count-of-substrings-containing-every-vowel-and-k-consonants-ii/)| Count Of Substrings Containing Every Vowel And K Consonants II |[c++](./leetcode/3306.count-of-substrings-containing-every-vowel-and-k-consonants-ii.cpp), [python3](./leetcode/3306.count-of-substrings-containing-every-vowel-and-k-consonants-ii.py)| Sliding Window | O\(N\)| O\(N\)| - |
824
828
|[Leetcode-2962](https://leetcode.com/problems/count-subarrays-where-max-element-appears-at-least-k-times/)| Count Subarrays Where Max Element Appears At Least K Times |[c++](./leetcode/2962.count-subarrays-where-max-element-appears-at-least-k-times.cpp), [python3](./leetcode/2962.count-subarrays-where-max-element-appears-at-least-k-times.py)| Sliding Window | O\(N\)| O\(1\)| - |
829
+
|[Leetcode-3298](https://leetcode.com/problems/count-substrings-that-can-be-rearranged-to-contain-a-string-ii/)| Count Substrings That Can Be Rearranged To Contain A String II |[c++](./leetcode/3298.count-substrings-that-can-be-rearranged-to-contain-a-string-ii.cpp), [python3](./leetcode/3298.count-substrings-that-can-be-rearranged-to-contain-a-string-ii.py)| Sliding Window | O\(N\)| O\(M\)| - |
825
830
|[Leetcode-3325](https://leetcode.com/problems/count-substrings-with-k-frequency-characters-i/)| Count Substrings With K Frequency Characters I |[c++](./leetcode/3325.count-substrings-with-k-frequency-characters-i.cpp), [python3](./leetcode/3325.count-substrings-with-k-frequency-characters-i.py)| Sliding Window | O\(N\)| O\(N\)| - |
831
+
|[Leetcode-2537](https://leetcode.com/problems/count-the-number-of-good-subarrays/)| Count The Number Of Good Subarrays |[c++](./leetcode/2537.count-the-number-of-good-subarrays.cpp), [python3](./leetcode/2537.count-the-number-of-good-subarrays.py)| Sliding Window | O\(N\)| O\(N\)| - |
|[Lintcode-3847](https://www.lintcode.com/problem/number-of-subarrays-having-even-product/)| Number Of Subarrays Having Even Product |[c++](./lintcode/3847.number-of-subarrays-having-even-product.cpp), [python3](./lintcode/3847.number-of-subarrays-having-even-product.py)| Array | O\(N\)| O\(1\)| Leetcode-2495 |
// Return the maximum value over all triplets of indices (i, j, k) such that i < j < k. If all such triplets have a negative value, return 0.
10
+
// The value of a triplet of indices (i, j, k) is equal to (nums[i] - nums[j]) * nums[k].
11
+
//
12
+
// Example 1:
13
+
//
14
+
// Input: nums = [12,6,1,2,7]
15
+
// Output: 77
16
+
// Explanation: The value of the triplet (0, 2, 4) is (nums[0] - nums[2]) * nums[4] = 77.
17
+
// It can be shown that there are no ordered triplets of indices with a value greater than 77.
18
+
//
19
+
// Example 2:
20
+
//
21
+
// Input: nums = [1,10,3,4,19]
22
+
// Output: 133
23
+
// Explanation: The value of the triplet (1, 2, 4) is (nums[1] - nums[2]) * nums[4] = 133.
24
+
// It can be shown that there are no ordered triplets of indices with a value greater than 133.
25
+
//
26
+
// Example 3:
27
+
//
28
+
// Input: nums = [1,2,3]
29
+
// Output: 0
30
+
// Explanation: The only ordered triplet of indices (0, 1, 2) has a negative value of (nums[0] - nums[1]) * nums[2] = -3. Hence, the answer would be 0.
0 commit comments