An integer array nums of length n is defined as trionic if there exist two indices p and q with p q n
The prefix from index p is strictly increasing: nums[0] nums[1] nums[p]
The segment from index p to index q is strictly decreasing: nums[p] nums[p + 1] nums[q]
The suffix from index q to index n nums[q] nums[q + 1] nums[n - 1]
Given an integer array nums, return true if nums is trionic, or false otherwise.
Constraints:
n
nums[i]
An integer array nums of length n is defined as trionic if there exist two indices p and q with p q n
The prefix from index p is strictly increasing: nums[0] nums[1] nums[p]
The segment from index p to index q is strictly decreasing: nums[p] nums[p + 1] nums[q]
The suffix from index q to index n nums[q] nums[q + 1] nums[n - 1]
Given an integer array nums, return true if nums is trionic, or false otherwise.
Constraints:
n
nums[i]