#3640
Trionic Array II
candidate master · 1505 · lc hard +32 · 47.3% accepted · 381 likes · top 32%
Description
Given an integer array nums of length n, a trionic subarray nums[l..r] (with l < r) has indices l < p < q < r such that nums[l..p] is strictly increasing, nums[p..q] is strictly decreasing, and nums[q..r] is strictly increasing. Return the maximum element sum of any such trionic subarray.
Code
1
2
3