problem link:
Discuss:
In this problem you have to first find the difference of successive element.and check is there all digit between 1 to n-1. to do so you can take a bool type array. find difference and check weather the number less then n and bool is true.if bool is true then make it false.if not then it's not jolly.
try yourself before see the code
Discuss:
In this problem you have to first find the difference of successive element.and check is there all digit between 1 to n-1. to do so you can take a bool type array. find difference and check weather the number less then n and bool is true.if bool is true then make it false.if not then it's not jolly.
try yourself before see the code