Minimum number of Merge Operations to make an Array Palindrome

Problem Statement In the “Minimum number of Merge Operations to make an Array Palindrome” problem we have given an array “a[]”. Find the minimum number of merge_operations are required to make an array palindrome. Note, A palindrome is a word, phrase, or sequence that reads the same backward as forwards. …

Read moreMinimum number of Merge Operations to make an Array Palindrome

Form Minimum Number from Given Sequence of D’s and I’s

Problem Statement In the “Form Minimum Number from Given Sequence of D’s and I’s” problem, we have given a pattern containing only I’s and D’s. I for increasing and D for decreasing. Write a program to print the minimum number following that pattern. Digits from 1-9 and digits can’t repeat. Input Format …

Read moreForm Minimum Number from Given Sequence of D’s and I’s

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

Find Zeros to be Flipped so that Number of Consecutive 1’s is Maximized

Problem Statement In the “Find Zeros to be Flipped so that Number of Consecutive 1’s is Maximized” problem we have given a binary array and a number x which denotes the no. of zeros to be flipped. Write a program to find the zeros that need to be flipped so …

Read moreFind Zeros to be Flipped so that Number of Consecutive 1’s is Maximized

Stock Buy Sell to Maximize Profit

Problem Statement In the “Stock Buy Sell to Maximize Profit” problem we have given an array that contains stock price on each day, find the maximum profit that you can make by buying and selling in those days. Here, we can buy and sell multiple times but only after selling …

Read moreStock Buy Sell to Maximize Profit