Find the start and end index of unsorted subarray such that sorting this subarray can sort all the array. INPUT_1:Array: 2 6 4 8 10 …

Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole…

Given an array of distinct n integers. The task is to check whether reversing one sub-array make the array sorted or not. If the array…

Three arrays of same size are given. Find a triplet such that maximum – minimum in that triplet is minimum of all the triplets. A…

Rearrange characters in a string such that no two adjacent are same.Given a string str, rearrange the characters of s so that any two adjacent…

We are given a matrix with R rows and C columns has cells with integer coordinates (rCenter, cCenter), where 0 <= r < R and…

Given an array of words, Group all anagrams together. Anagrams : a word, phrase, or name formed by rearranging the letters of another, such as spar, formed…

Given an array of words, print all anagrams together. Anagrams : a word, phrase, or name formed by rearranging the letters of another, such as spar,…

Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],…] (si < ei), determine if a person could attend all meetings.…

Tina’s trainer have given her two positive integers U and V. Now her task is to find the number of pairs if positive intgers(X,Y)such that…

Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies:Si % Sj=…

Multiple Queries using array numsGiven an integer array nums, handle multiple queries of the following types:Update the value of an element in nums.Calculate the sum…

All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: “ACGAATTCCG”. When studying DNA, it is sometimes…

You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores…

Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3]…. Input_1:Array_nums : 20 10 8 6 4 2Output:[2, 10, 6, 8, 4,…

Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is…

Given a non-empty array of numbers, a0, a1, a2 ….. where 0 ≤ ai < 2^31. Find the maximum result of ai XOR aj, where 0 ≤ i, j < n. Could you…

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may…

Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Input_1:Enter a list of arrays…

A chocolate factory is packing chocolates into the packets. The chocolate packets here represent an array arrt of N number of integer values. The task…