Tap here to switch tabs
Problem
Submissions

Problem: Prime Subtraction Operation

Prime Subtraction Operation asks whether an integer array can be made strictly increasing by subtracting one prime, smaller than its value, from selected elements at most once.

Statement

You are given a 00 indexed integer array nums of length n.

You can perform the following operation any number of times:

  • Select an index i that has not been chosen previously.

  • Choose a prime number p that is strictly less than nums[i].

  • Subtract p from nums[i].

Return true if you can make nums strictly increasing after applying the operations, or false otherwise.

Note: An array is considered strictly increasing if nums[i - 1] << nums[i] for all 1≤1 \leq i << n.

Constraints:

  • 1≤1 \leq nums.length ≤1000\leq 1000

  • 1≤1 \leq nums[i] ≤1000\leq 1000

  • nums.length ==== n

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Prime Subtraction Operation

Prime Subtraction Operation asks whether an integer array can be made strictly increasing by subtracting one prime, smaller than its value, from selected elements at most once.

Statement

You are given a 00 indexed integer array nums of length n.

You can perform the following operation any number of times:

  • Select an index i that has not been chosen previously.

  • Choose a prime number p that is strictly less than nums[i].

  • Subtract p from nums[i].

Return true if you can make nums strictly increasing after applying the operations, or false otherwise.

Note: An array is considered strictly increasing if nums[i - 1] << nums[i] for all 1≤1 \leq i << n.

Constraints:

  • 1≤1 \leq nums.length ≤1000\leq 1000

  • 1≤1 \leq nums[i] ≤1000\leq 1000

  • nums.length ==== n