Equilibrium Point
Given an array of integers arr[],the task is to find the first equilibrium point in the array. The equilibrium point in an array […]
Given an array of integers arr[],the task is to find the first equilibrium point in the array. The equilibrium point in an array […]
You are given a string s. You can perform the following process on s any number of times: Choose an index i in the string such
Given an array arr[] of non-negative integers, where each element arr[i] represents the height of the vertical lines, find the maximum amount of water that can be contained between
A parentheses string is a non-empty string consisting only of ‘(‘ and ‘)’. It is valid if any of the following conditions is true: It is (). It can
Given an array arr[] with non-negative integers representing the height of blocks. If the width of each block is 1, compute how
Given a string s and an integer k, return true if you can use all the characters in s to construct k palindrome strings or false otherwise. Example 1: Input: s
Given a string s, find the length of the longest substring with all distinct characters. Examples: Input: s = “geeksforgeeks” Output:
You are given an array of strings words and a string pref. Return the number of strings in words that contain pref as a prefix. A prefix of a string s is any
Given an array arr[] containing only non-negative integers, your task is to find a continuous subarray (a contiguous sequence of elements) whose
You are given a 0-indexed string array words. Let’s define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2: isPrefixAndSuffix(str1, str2) returns true if str1 is both a prefix and a suffix of of str2, and false otherwise. For
Given an integer array arr[]. Find the number of triangles that can be formed with three different array elements as lengths
Given an array of string words, return all strings in words that is a substring of another word. You can return the answer in any order. A substring is