import java.util.*;

/*
 * public class ListNode {
 *   int val;
 *   ListNode next = null;
 *   public ListNode(int val) {
 *     this.val = val;
 *   }
 * }
 */

public class Solution {

    public ListNode vectorToListnode (int[] arr) {
        if(arr.length==0)return null;
        ListNode head = new ListNode(0);
        ListNode res = head;
        for (int i = 0; i < arr.length; i++) {
            head.val = arr[i];
            ListNode temp = new ListNode(0);
            if (i != arr.length - 1) {
                head.next = temp;
                head = head.next;
            }
        }
        return res;
    }
}