There is an array containing prices of n tickets. A number m is defined as the size of a subsequence S of tickets. Each element in the subsequence covers a continuous range ...read more
Sorting is one of the most fundamental thing in all programming languages. One of the Simple Approach is to use sort() function in Kotlin. In Kotlin any Data types of an Array ...read more
Given an integer k and array of length N find the min no of move to make all the elements divisible by k. In one move you can go one of the ...read more
Given an array arr[ ] of N non-negative integers, the task is to sort these integers according to sum of their digits. Examples : Input : 12 10 102 31 15 Output ...read more
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