Convert a String that is Repetition of a Substring of Length K

Problem Statement In the “Convert a String that is Repetition of a Substring of Length K” problem we have given a string “s” and an integer “k”. Write a program to check whether is it possible to convert it to a string that is the repetition of a substring with …

Read moreConvert a String that is Repetition of a Substring of Length K

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 Span with same Sum in two Binary Arrays II

Problem Statement In the “Longest Span with same Sum in two Binary Arrays II” problem, we have given two binary arrays “a” and “b” with the same size. Write a program to print the longest span with the same sum in two arrays. This can be clearly explained in the …

Read moreLongest Span with same Sum in two Binary Arrays II

Find the Subarray of given length with Least Average

Problem Statement In the “Find the Subarray of given length with Least Average” problem we have given an array and an input integer X. Write a program to find the subarray of length X with least/minimum average. Prints the starting and ending indexes of the subarray which has the least …

Read moreFind the Subarray of given length with Least Average