I am trying to implement this in Java but i dont know what the implementation of


#1

I am trying to implement this in Java but i dont know what the implementation of a ListNode is so I dont know how to access the data in the ListNode. any ideas?


#2

Shown in the comments in the editor above the class template:
/**
* Definition for singly-linked list.
* class ListNode {
* public int val;
* public ListNode next;
* ListNode(int x) { val = x; next = null; }
* }
*/