A number N is represented in Linked List such that each digit corresponds to a node in linked list. You need to add 1 to it.
Your task is to complete the function addOne() which takes the head of the linked list as the only argument and returns the head of the modified linked list. The driver code prints the number. Note: The head represents the left-most digit of the number.
Expected Time Complexity: O(N). Expected Auxiliary Space: O(1).