Defination of ListNode class. Adding print function for debugging. Need to import this class when dealing with linked list problems