921. Minimum Add to Make Parentheses Valid
A parentheses string is valid if and only if: It is the empty string, It can be written as AB (A concatenated with B), […]
A parentheses string is valid if and only if: It is the empty string, It can be written as AB (A concatenated with B), […]
Given a Matrix mat of n*n size. Your task is constructing a 2D linked list representation of the given matrix. Input: mat = [[1,
You are given a 0-indexed string s of even length n. The string consists of exactly n / 2 opening brackets ‘[‘ and n / 2 closing brackets ‘]’. A string is called balanced if and only
Find the largest pair sum in an array of distinct integers. Examples : Input: arr[] = [12, 34, 10, 6, 40] Output:
You are given a string s consisting only of uppercase English letters. You can apply some operations to this string where, in one operation,
An ordinary Doubly Linked List requires space for two address fields to store the addresses of previous and next nodes.
You are given two strings sentence1 and sentence2, each representing a sentence composed of words. A sentence is a list of words that are separated by a single space
Given a grid of size n*m (n is the number of rows and m is the number of columns in
Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. In other words, return true if one of s1‘s permutations is the substring of s2. Example 1:
Given a sorted array arr[] of positive integers, find the smallest positive integer such that it cannot be represented as the sum
You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that
Given a Circular Linked List. The task is to delete the given node, key in the circular linked list, and reverse the