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 →
Arrays
106 postsGiven 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 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 →
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 →
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 →
Mex of an array is the smallest non-negative integer that does not appear in the array. Given an array of non-negative integers, find mex of its elements. Examples : Input : arr[] Read more →
Given an array arr of size n, the task is to sort this array using minimum swaps. We are allowed to swap only adjacent elements. Examples: Input: arr[] = {1, 4, 3, Read more →