Kth Non-repeating Character

Problem Statement In the “Kth Non-repeating Character” we have given a string “s”. Write a program to find out the kth non-repeating_character. If there are less than k character which is non-repeating in the string then print “-1”. Input Format The first and only one line containing a string “s”. …

Read moreKth Non-repeating Character

Longest Common Prefix Word by Word Matching

Problem Statement In the “Longest Common Prefix using Word by Word Matching” problem, we have given N strings.  Write a program to find the longest common prefix of the given strings. Input Format The first line containing an integer value N which denotes the number of strings. Next N lines …

Read moreLongest Common Prefix Word by Word Matching

Longest Common Prefix using Character by Character Matching

Problem Statement In the “Longest Common Prefix using Character by Character Matching” problem we have given an integer value N and N strings. Write a program to find the longest common prefix of the given strings. Input Format The first line containing an integer value N which denotes the number …

Read moreLongest Common Prefix using Character by Character Matching

Permutations of a Given String Using STL

Problem Statement In the “Permutations of a Given String Using STL” problem, we have given a string “s”. Print all the permutations of the input string using STL functions. Input Format The first and only one line containing a string “s”. Output Format Print all the permutation of the given …

Read morePermutations of a Given String Using STL

Longest Common Prefix using Divide and Conquer

Problem Statement In the “Longest Common Prefix using Divide and Conquer ” problem, we have given an integer n and n strings. Write a program that will print the longest common prefix. If there is no common prefix then print “-1”. Input Format The first line contains an integer n. …

Read moreLongest Common Prefix using Divide and Conquer

Longest Common Prefix Using Binary Search II

Problem Statement In the “Longest Common Prefix Using Binary Search II” problem we have given an integer value N and N strings. Write a program that will print the longest common prefix of given strings. If there is no common prefix then print “-1”. Input Format The first line containing …

Read moreLongest Common Prefix Using Binary Search II

Merge Overlapping Intervals II

Problem Statement In the “Merge Overlapping Intervals II” problem we have given a set of intervals. Write a program that will merge the overlapping intervals into one and print all the non-overlapping intervals. Input Format The first line containing an integer n. Second-line containing n pairs where each pair is …

Read moreMerge Overlapping Intervals II