Find All Triplets with Zero Sum
Given an array arr[], find all possible indices [i, j, k] of triplets [arr[i], arr[j], arr[k]] in the array whose sum is equal to zero. Return indices of […]
Given an array arr[], find all possible indices [i, j, k] of triplets [arr[i], arr[j], arr[k]] in the array whose sum is equal to zero. Return indices of […]
Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift on s consists of moving the leftmost character of s to the rightmost
Given a linked list, your task is to complete the function isLengthEven() which contains the head of the linked list, and check whether the length
A sentence is a list of words that are separated by a single space with no leading or trailing spaces. For example, “Hello World”, “HELLO”, “hello world
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