Find length of Longest Consecutive Occurrences of second string that occurs in first string

You are given two strings string1 and string2. Your task is to find length of longest consecutive occurrences of second string that occurs in first string. Examples: Input: string1=”AAACBBAAAA”,  string2=”A” Output: 4 Explanation: We will get AAA(0:3) and then AAAA(6:10) as 4 is greater than 3, answer is 4. Input: string1=”ABBABBABBAAAA”,  string2=”ABB” Output: 9 Approach: Initially find length… Read More »

What are the advantages of the Internet?

Here in this article we will discuss about the various ways through which the net is headed up in the world. Employment Opportunities: Employment opportunities will get open up through internet as e commerce is making Rapid strides in India so various number of Companies a logging only internet we have created many career opportunities through web like… Read More »

Sort odd indices in ascending order and even indices in descending order of the string

Given a string S, the task is to sort odd indices in ascending order and even indices in descending order of the string. Examples: Input: S = “Cplusplus” Output: Cululspsp Explanation: Sort string S in ascending order: S = “Cululspsp” Replace odd indices in ascensing order and even indices in descending order. Input: S = “plusplus” Output: lulupsps… Read More »