You are given an array of integers `sequence` of length `n`, find all subsequences of length `9` where the sum of the first `7` elements equals the sum of the last `7` elements, and the middle element is the maximum of the subsequence.
Explanation: The sum of the first 7 elements (1+2+3+4+5+6+7) equals the sum of the last 7 elements (3+4+5+6+7+8+9) and the middle element 5 is the maximum of the subsequence.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak