AfterAcademy Tech
You are given an unsorted array A[] consisting of N elements and you need to remove all the duplicate elements from the array. All the elements in the resultant array must be unique.
You are given a sorted and infinite array A and an element K. You need to search for the element K in the array. If found, return the index of the element, else return -1.
You are given an array A[] with n elements. You need to find the maximum sum of a subarray among all subarrays of that array. A subarray of array A[] of length n is a contiguous segment from A[i] through A[j] where 0<= i <= j <= n.
Given an array A[] of n elements and a positive integer K, find the Kth smallest element in the array. It is given that all array elements are distinct.
Given two strings S1 and S2 of size m and n respectively, you need to check whether the two strings are an anagram of each other or not. S1 is an anagram of S2 if the characters of S1 can be rearranged to form S2.
Given an array A[] of size n, you need to find the maximum and minimum element present in the array.Your algorithm should make minimum number of comparisons.
Given an unsorted array A[] consisting of n integers, you need to find the length of the longest consecutive sequence of integers in the array.
Given two integer arrays A[] and B[] of size m and n, respectively. We need to find the intersection of these two arrays. The intersection of two arrays is a list of distinct numbers which are present in both the arrays. The numbers in the intersection can be in any order.
Write a program that, Given an array of n integers and given a number K, determines whether or not there exist two elements whose sum is exactly K.
Given two integer array A[] and B[] of size m and n(n <= m) respectively. We have to check whether B[] is a subset of A[] or not. An array B is a subset of another array A if each element of B is present in A. (There are no repeated elements in both the arrays)