Problem of the day
Tip 1 : Practice on gfg
Tip 2 : Compete on codechef
Tip 3 : Learn DSA
Tip 1 : Mention all projects
Tip 2 : Don't write anything that you don't know
It was a coding round on Hackerrank.
Keep the maximum and minimum range of values that are possible for each and every node and keep on recursively calling the same function for the children of current node, if it's not satisfying at any point, return false
The given linked list is 1 -> 2 ->...
Maintain three pointers next, curr, previous and at every stage make prev=curr, curr=next and next=next->next
At the end when null occurs, make curr as head and return head