Discuss / Java / 练习题2

练习题2

Topic source

追风少年

#1 Created at ... [Delete] [Delete and Lock User]
    static int findMissingNumber(int start, int end, List<Integer> list) {
        for (; start <= end; start++) {
            if (list.contains(start)) {
                continue;
            } else {
                return start;
            }
        }

        return 0;
    }

  • 1

Reply