# 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: 2

Example 2:
Input: arr[] = {1,1,1,1}
Output: 5

Example 3:
Input: arr[] = {1,1,3,4}
Output: 10

Example 4:
Input: arr[] = {2}
Output: 1

# Find the Missing Number

Problem: You are given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in the list. One of the integers is missing in the list. Write an efficient code to find the missing integer. By efficient we mean in O(n) time.

Example:
Input: [1,2,4,6,3,7,8] // Array of size =7 = 8–1, so n=8
Output: 5

# Remove Vowels

Problem: Given a word/string remove all of the vowels {a,e,i,o,u,y} from that word.

Example:
Input: Apple
Output: ppl

# Anagram

Problem: Write a method to decide if two strings are anagrams of each other. An anagram is a word or phrase that can be formed by rearranging letters of another word or phrase, for example cinema can be formed from iceman.

Example 1:
Output: Yes, they are anagrams

Example 2:
Input 1: MOM
Input 2: TOM
Output: No, they are NOT anagrams

# Check If Array is Unique

Problem: Implement an algorithm to determine if a string has all unique characters in O(n).

Example1:
Input: “hello”
Output: No the string is not unique

Example2:
Input: “car”
Output: Yes the string is unique

# Integer Palindrome

Problem: Check if an integer is a palindrome, meaning the number reversed is the same number in O(n) time.

Example 1:
Input: 12321
Output: 12321 is a Palindrome

Example 2:
Input: 12
Output: 12 is NOT a palindrome

# String Palindrome

Problem: Determine if a word or string is a palindrome, meaning the word is the same when reversed.

Example 1:
Input: “MOM”
Output: “MOM” is a palindrome

Example 2:
Input: “TOM”
Output: “TOM” is not a palindrome

# Get the code below:

Also a great book to prepare you for coding/programming interviews is called cracking the coding interview. It will help you familiarize yourself with sorting algorithms and problem solving, so be sure to check it out !

Thanks for reading this article I hope its helpful to you all ! Keep up the learning, and if you would like more computer science, programming and algorithm analysis videos please visit and subscribe to my YouTube channels (randerson112358 & compsci112358 )

# Check Out the following for content / videos on Computer Science, Algorithm Analysis, Programming and Logic:

compsci112358:

Video Tutorials on Recurrence Relation:

Video Tutorial on Algorithm Analysis:
https://www.udemy.com/algorithm-analysis/

Written by