Minimum repeat to make substring
Given two strings s1 and s2. Return a minimum number of times s1 has to be repeated such that s2 is a substring of […]
Given two strings s1 and s2. Return a minimum number of times s1 has to be repeated such that s2 is a substring of […]
The bitwise AND of an array nums is the bitwise AND of all integers in nums. For example, for nums = [1, 5, 3], the bitwise
Given anarray, arr[], determine if arr can be split into three consecutive parts such that the sum of each part is equal. If possible,
You are given a 0-indexed array of positive integers nums. In one operation, you can swap any two adjacent elements if they have the same number of set bits. You
Given a binary tree, where every node value is a number. Find the sum of all the numbers that are
You are given a 0-indexed binary string s having an even length. A string is beautiful if it’s possible to partition it into one or more
Given asquare matrix[][]. The task is to rotate it by 90 degrees in clockwise direction without using any extra space. Examples: Input: mat[][]
Given a string word, compress it using the following algorithm: Begin with an empty string comp. While word is not empty, use the following operation: Remove
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