1653. Minimum Deletions to Make String Balanced
You are given a string s consisting only of characters ‘a’ and ‘b’. You can delete any number of characters in s to make s balanced. s is balanced if there is no […]
You are given a string s consisting only of characters ‘a’ and ‘b’. You can delete any number of characters in s to make s balanced. s is balanced if there is no […]
Consider a rat placed at (0, 0) in a square matrix mat of order n* n. It has to reach the destination at (n – 1,
There are n soldiers standing in a line. Each soldier is assigned a unique rating value. You have to form a team of 3 soldiers
Given a boolean 2D array, consisting of only 1’s and 0’s, where each row is sorted. Find the 0-based index of
A city is represented as a bi-directional connected graph with n vertices where each vertex is labeled from 1 to n (inclusive). The edges in the graph are
Given a string str without spaces, the task is to remove all duplicate characters from it, keeping only the first occurrence. Note: The
You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English letters. You are also given two 0-indexed character arrays original and changed, and an integer array cost,
Given a string, find the minimum number of characters to be inserted to convert it to a palindrome. Examples :
There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge between cities fromi and toi, and given
Given a string str and an integer k, return true if the string can be changed into a pangram after at most k operations, else
Given an array of integers nums, sort the array in ascending order and return it. You must solve the problem without using
Given a sorted array. Convert it into a Height Balanced Binary Search Tree (BST). Return the root of the BST. Height-balanced BST means a binary tree in