Tap here to switch tabs
Problem
Submissions

Problem: Trionic Array I

med
30 min
Try to solve the Trionic Array I problem.

Statement

An integer array nums of length n is defined as trionic if there exist two indices p and q with 0<0 < p << q << n −1- 1 such that:

  • The prefix from index 00 to index p is strictly increasing: nums[0] << nums[1] << …\dots << nums[p]

  • The segment from index p to index q is strictly decreasing: nums[p] >> nums[p + 1] >> …\dots >> nums[q]

  • The suffix from index q to index n −1- 1 is strictly increasing: nums[q] << nums[q + 1] << …\dots << nums[n - 1]

Given an integer array nums, return true if nums is trionic, or false otherwise.

Constraints:

  • 3≤3 \leq n ≤100\leq 100

  • −1000≤-1000 \leq nums[i] ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Trionic Array I

med
30 min
Try to solve the Trionic Array I problem.

Statement

An integer array nums of length n is defined as trionic if there exist two indices p and q with 0<0 < p << q << n −1- 1 such that:

  • The prefix from index 00 to index p is strictly increasing: nums[0] << nums[1] << …\dots << nums[p]

  • The segment from index p to index q is strictly decreasing: nums[p] >> nums[p + 1] >> …\dots >> nums[q]

  • The suffix from index q to index n −1- 1 is strictly increasing: nums[q] << nums[q + 1] << …\dots << nums[n - 1]

Given an integer array nums, return true if nums is trionic, or false otherwise.

Constraints:

  • 3≤3 \leq n ≤100\leq 100

  • −1000≤-1000 \leq nums[i] ≤1000\leq 1000