Skip to content

Tag Archives: prefix

Given a string, print all the possible substrings which are also the prefix of the given string. Examples: Input : ababc Output : a, ab,… Read More
Given a string str, the task is to count all possible sub-strings of the given string that are prefix of the same string. Examples:  Input:… Read More
Given an array of elements ‘arr’, the task is to maximize the sum of the elements of this array after performing the following operation: You can… Read More
Given two strings and . Find the longest common prefix between them after performing zero or more operations on string . In each operation, you can swap any… Read More
Given a String and an array of prefixes. The task is to check whether the given String starts with any of the given prefixes or… Read More
Given a set of strings, find the longest common prefix. Examples:  Input: str[] = {geeksforgeeks, geeks, geek, geezer} Output: gee Input: str[] = {apple, ape,… Read More
Given, an array of size N. Find an element which divides the array into two sub-arrays with equal product. Print -1 if no such partition… Read More
Given an array of n elements and an integer m, we need to write a program to find the number of contiguous subarrays in the… Read More
Given an array of n integers, and three integers x, y and z. maximize the value of (x * a[i]) + (y * a[j]) +… Read More

Start Your Coding Journey Now!