Constrain an Increasing Array With Minimum Adjacent Difference

Given a randomized dynamic integer array arr, write a SystemVerilog constraint such that the array is strictly increasing and the difference between every adjacent pair is at least 2.

For every ind...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: