Algorithm · Apple · Medium
Strictly Increasing Array Constraint Easy · SystemVerilog, Constraints · Company Tags · Hints Design a SystemVerilog constraint for a dynamic integer array arr that enforces two rules: the array elements must appear in strictly increasing order, and the gap between every consecutive pair must be at least 2. Specifically, for any index i where 1 = arr[i-1] + 2 must hold. The array may have zero, one, or more elements. For an empty array or an array with a single element, the…
Checking your access…