Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each the array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in the array.
Given a string of lowercase letters in the range ascii[a-z], determine the index of a character that can be removed to make the string a palindrome
Given an integer range, for all M in that inclusive range, determine the minimum (abs(arr[i]-M) for all
1 <= i <= size[a]
Print all the nodes that you encounter while printing DFS tree. Then, print the distance ‘D’ between the source ‘P’ and the destination ‘.’
Given a string s such that, s ∈ merge(reverse(A), shuffle(A)) for some string A, find the lexicographically smallest A
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For n = 2, output: [“(())”,”()()”]
Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.
Given a string s, consisting of English letters, symbols and spaces, find the length of the longest substring without repeating characters.
Problem In this problem, we’ll use the term “longest common substring” loosely. It refers to substrings differing at some number or fewer characters when compared index by index. For example, ‘abc’ and ‘adc’ differ in one position, ‘aab’ and ‘aba’ differ in two. Given two strings and an integer , determine the […]
Problem Two words are anagrams of one another if their letters can be rearranged to form the other word. Given a string, split it into two contiguous substrings of equal length. Determine the minimum number of characters to change to make the two substrings into anagrams of one another. Example s […]