private static ListNode convertArrayToNodeList(int[] arr) {
        if (arr.length < 1) return null;
        ListNode[] nodeArr = new ListNode[arr.length];
        nodeArr[arr.length - 1] = new ListNode(arr[arr.length - 1]);
        for (int i = arr.length - 2; i >= 0; i--) {
            nodeArr[i] = new ListNode(arr[i]);
            nodeArr[i].next = nodeArr[i + 1];
        }
        
        return nodeArr[0];
    }