public class ListNode {
public int val;
public ListNode next;
public ListNode(int x) {
val = x;
}
public static ListNode make(int[] arr) {
ListNode head = new ListNode(arr[0]);
ListNode tail = head;
for (int i = 1; i < arr.length; i++) {
tail.next = new ListNode(arr[i]);
tail = tail.next;
}
return head;
}
}