Given an n x n matrix, where every row and column is sorted in non-decreasing order. Find the kth smallest element in the given 2D…
Given an integer array of size n, find all elements that appear more than [n/3] times. If no such element exists, return -1. Input_1:Array : 20,30,10,10,5,4,20,1,2…
Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the…
Given an unsorted array of integers, sort the array into a wave like array. An array ‘arr[0..n-1]’ is sorted in wave form if arr[0] >=…
Given an integer array nums, re-order it such that nums[0] < nums[1] > nums[2] < nums[3]….You may assume the input array always has a valid answer. Input_1:Array_nums…
Given the coordinates of four points in 2D space p1, p2, p3 and p4, return true if the four points construct a square. The coordinate…
Given a string s and two words w1 and w2 that are present in S. The task is to find the minimum distance between w1…
Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. For example,Assume that…
Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2,3,5. Input: n= 10 Output: 12Explanation:…
Given an array nums with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. We define…
Given an array of set of points in the X-Y plane. The task is to find the minimum area of a rectangle that can be…
RomanizerConvert numbers into roman numerals. Examplenumbers = [1,49,23]Looking at the conversions above, 1 is represented as I(capital I which is roman number), 48 is 40…
Given the string s, return the size of the longest sub-string containing each vowel an even number of times. That is, ‘a’,’e’,’i’,’o’,’u’ must appear an…
Given an array of string words. Return all strings in words which is sub-string of another word in any order. String words[i] is sub-string of…
Given an array of integers nums, you start with an initial positive value startValue. In each iteration, you calculate the step by step sum of…
Given the number k, return the minimum number of Fibonacci numbers whose sum is equal to k, whether a Fibonacci number could be used multiple…
Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty sub-strings (i.e. left sub-strings and right…
Given a sorted array and a value x, the floor of x is the largest element in array smaller than or equal to x. Write…
Print all numbers less than NGiven integer n, you need to print all numbers less than n which are having digits only 3 or 7…
Given an array of integers and numbers k and m, write a function that returns true if given array can be divided into pairs such…