Tag Archives: sum

Given a sorted array, find the smallest positive integer that is not the sum of a subset of the array.

By | June 27, 2023

Java public class SmallestPositiveInteger {    public static int findSmallestPositiveInteger(int[] nums) {        int smallest = 1;        for (int num : nums) {            if (num <= smallest) {                smallest += num;            } else… Read More »