Prime Subtraction Operation
You are given a 0-indexed integer array nums of length n.
You can perform the following operation as many times as you want:
- Pick an index
ithat you haven’t picked before, and pick a primepstrictly less thannums[i], then subtractpfromnums[i].
Return true if you can make nums a strictly increasing array using the above operation and false otherwise.
A strictly increasing array is an array whose each element is strictly greater than its preceding element.
Example 1
Input
nums = [4,9,6,10]Output
trueAfter subtracting 3 from nums[0] and 7 from nums[1], nums becomes [1, 2, 6, 10], which is strictly increasing.
Example 2
Input
nums = [6,8,11,12]Output
trueInitially nums is sorted in strictly increasing order, so no operations are needed.
Constraints
- 1 <= nums.length <= 1000
- 1 <= nums[i] <= 1000
- nums.length == n