public static ListNode buildListFromArray(int[] array) {
		if (array.length == 0) {
			return null;
		}

		ListNode head = new ListNode(array[0]);
		ListNode pre = head;
		for (int i = 1; i < array.length; i++) {
			ListNode node = new ListNode(array[i]);
			pre.next = node;
			pre = node;
		}

		return head;
	}