Given two positive integers. Count the number of pairs (a, b) such that 1 ≤ a ≤ x, 1 ≤ b ≤ y and a+b is even. Examples: Input: 2 7 Output: Count of pairs Read more →
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 Read more →
Given an array of size N. The task is to find the maximum and the minimum element of the array using the minimum number of comparisons. Examples: Input : A[]={4,2,-1,5,0,-5,7,3,6} Output : Read more →
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 Read more →
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 Read more →
Given an array A[ ] of N segments find any point common to maximum number of segments and also find the number of segments which it is common to. The segments are Read more →
You are given a string s consisting only of characters ‘a’ and ‘b’. You can delete any number of characters in s to make s balanced. s is balanced if there is Read more →
Given an array (with all elements greater than 0), create a non-decreasing array by swapping 2 elements if their gcd(Greatest Common Factor) is equal to the minimum element of the array. You Read more →
Given three arrays start[], duration[], amount[] of length N. A person can make money of amount[i] working for the time period [start[i], start[i]+duration[i]] on task i. Maximum amount of money a person Read more →
Given start and end time of all the cars in a given interval, find the maximum time gap in which no car travels. The start timings are given in sorted order. Examples: Read more →