Kth distance
Given an unsorted array arr and anumber k which is smaller than size of the array. Find if the array contains duplicates within k distance. Examples: […]
Given an unsorted array arr and anumber k which is smaller than size of the array. Find if the array contains duplicates within k distance. Examples: […]
A fancy string is a string where no three consecutive characters are equal. Given a string s, delete the minimum possible number of characters from s to make it fancy. Return the
Given an array arr[ ] of positive elements. Consider the array as a circular array, meaning the element after the last element
There are some robots and factories on the X-axis. You are given an integer array robot where robot[i] is the position of the ith robot. You
Given a sorted doubly linked list and an element x, you need to insert the element x into the correct position in the
You may recall that an array arr is a mountain array if and only if: arr.length >= 3 There exists some index i (0-indexed) with 0 <
Given an array arr[] of positive integers. Find the number of pairs of integers whose difference equals a given number k.Note: (a,
You are given a 0-indexed m x n matrix grid consisting of positive integers. You can start at any cell in the first column of the matrix, and traverse
You are given a Linked List. Sort the given Linked List using quicksort. Examples: Input: Linked list: 1->6->2Output: 1->2->6Explanation:After sorting the
You are given an integer array nums. A subsequence of nums is called a square streak if: The length of the subsequence is at least 2,
Given an array arr consisting of positive integer numbers, remove all duplicate numbers. Example: Input: arr[] = [2, 2, 3, 3, 7,
Given a m * n matrix of ones and zeros, return how many square submatrices have all ones. Example 1: Input: matrix = [