In reply to fenil_shah:
Can you find one valid solution with values for the array that satisfy the constraints?