Member-only story
Practice Programming Problems
If you are a programmer or a developer it is good to stay sharp on your coding skills. In this article we will explore some practice programming problems using the C -Programming language.
Find The Smallest Positive Integer Value
Problem: Given a sorted array that is in non-decreasing order and made of positive integers, find the smallest positive integer value that cannot be represented as a sum of the elements of any subset of the given set. You are expected to solve this in O(n) time.
Example 1:
Input: arr[] = {1,3,6,10,11,15};
Output: 2Example 2:
Input: arr[] = {1,1,1,1}
Output: 5Example 3:
Input: arr[] = {1,1,3,4}
Output: 10Example 4:
Input: arr[] = {2}
Output: 1









