#3637

Trionic Array I

easy · 49.5% accepted · 469 likes · top 36%

array

Description

You are given an integer array nums of length n.

An array is trionic if there exist indices 0 < p < q < n &minus; 1` such that:

nums[0...p]` is strictly increasing,

nums[p...q]` is strictly decreasing,

nums[q...n &minus; 1]` is strictly increasing.

Return true if nums is trionic, otherwise return false`.

Solution