3637. Trionic Array I Easy

@problem@discussion
#Array



1/**
2 * [3637] Trionic Array I
3 *
4 * <p data-end="128" data-start="0">You are given an integer array <code data-end="37" data-start="31">nums of length <code data-end="51" data-start="48">n.
5 * <p data-end="128" data-start="0">An array is <strong data-end="76" data-start="65">trionic if there exist indices <code data-end="117" data-start="100">0 < p < q < n - 1 such that:
6 * 
7 * 	<li data-end="170" data-start="132"><code data-end="144" data-start="132">nums[0...p] is strictly increasing,
8 * 	<li data-end="211" data-start="173"><code data-end="185" data-start="173">nums[p...q] is strictly decreasing,
9 * 	<li data-end="252" data-start="214"><code data-end="228" data-start="214">nums[q...n - 1] is strictly increasing.
10 * 
11 * <p data-end="315" data-is-last-node="" data-is-only-node="" data-start="254">Return <code data-end="267" data-start="261">true if <code data-end="277" data-start="271">nums is trionic, otherwise return <code data-end="314" data-start="307">false.
12 *  
13 * <strong class="example">Example 1:
14 * <div class="example-block">
15 * Input: <span class="example-io">nums = [1,3,5,4,2,6]</span>
16 * Output: <span class="example-io">true</span>
17 * Explanation:
18 * Pick <code data-end="91" data-start="84">p = 2, <code data-end="100" data-start="93">q = 4:
19 * 
20 * 	<code data-end="130" data-start="108">nums[0...2] = [1, 3, 5] is strictly increasing (<code data-end="166" data-start="155">1 < 3 < 5).
21 * 	<code data-end="197" data-start="175">nums[2...4] = [5, 4, 2] is strictly decreasing (<code data-end="233" data-start="222">5 > 4 > 2).
22 * 	<code data-end="262" data-start="242">nums[4...5] = [2, 6] is strictly increasing (<code data-end="294" data-start="287">2 < 6).
23 * </div>
24 * <strong class="example">Example 2:
25 * <div class="example-block">
26 * Input: <span class="example-io">nums = [2,1,3]</span>
27 * Output: <span class="example-io">false</span>
28 * Explanation:
29 * There is no way to pick p and q to form the required three segments.
30 * </div>
31 *  
32 * Constraints:
33 * 
34 * 	<li data-end="41" data-start="26"><code data-end="39" data-start="26">3 <= n <= 100
35 * 	<li data-end="70" data-start="44"><code data-end="70" data-start="44">-1000 <= nums[i] <= 1000
36 * 
37 */
38pub struct Solution {}
39
40// problem: https://leetcode.com/problems/trionic-array-i/
41// discuss: https://leetcode.com/problems/trionic-array-i/discuss/?currentPage=1&orderBy=most_votes&query=
42
43// submission codes start here
44
45impl Solution {
46    pub fn is_trionic(nums: Vec<i32>) -> bool {
47        false
48    }
49}
50
51// submission codes end
52
53#[cfg(test)]
54mod tests {
55    use super::*;
56
57    #[test]
58    fn test_3637() {
59    }
60}
61

Back
© 2026 bowen.ge All Rights Reserved.