Problem Statement: You are given an array, you need to find the maximum sun of absolute difference of any permutation in the given array. Example Input: 1, 2, 7 Output: 11 Explanation: sum = |1 - 7| + |7 - 2| = 11. So the arrangement …
Problem Statement: You are given an array of CPU tasks and a cool off period between the same task “n”. You need to re-arrange the tasks such that, the time run should be minimum. Example Input: tasks = , n = 2 Output: 8 Explanation: …
Problem Statement: You are given 2 array of equal size. You need to rearrange the first array in such a way that at any point of time a > b Example Input: A = , B = Output: Here a is always greater than b …
Problem Statement: You are given array that represents flowerbed, where some plants are placed. You are also given new flowers to be placed. You need to place the flowers in such a way that they should not be placed adjacent. You need to return true or …
Problem Statement: You are given an array of intervals . You need to return minimum number of intervals to remove to make the rest of the intervals non-overlapping Example Input: intervals = ,,,] Output: 1 You need to remove to make rest of the intervals …
Problem Statement: You are given 2 strings s, t. You need to check if s is a substring of t. A substring of a string is a new string that is formed by deleting some of the character without disturbing the relative position. Example Input: …
Problem Statement: You are given an array of arrival and departure timings for train at a station. You need to find the minimum umber of platforms required such that no train waits. Example arrival = {9:00, 9:40, 9:50, 11:00, 15:00, 18:00} departure = {9:10, 12:00, 11:20, …