k-th Smallest in BST
Given a BST and an integer k, the task is to find the kth smallest element in the BST. If there is no kth […]
Given a BST and an integer k, the task is to find the kth smallest element in the BST. If there is no kth […]
Given two strings s and part, perform the following operation on s until all occurrences of the substring part are removed: Find the leftmost occurrence of the substring part and remove it from s. Return s after removing
You are given a string s. Your task is to remove all digits by doing this operation repeatedly: Delete the first digit and the closest non-digit character to
Given a binary tree and an integer k, determine the number of downward-only paths where the sum of the node values in the path equals k.
You are given two strings s1 and s2 of equal length. A string swap is an operation where you choose two indices in a string (not
Given a binary tree, the diameter (also known as the width) is defined as the number of edges on the longest path between two
Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums. A subarray is defined as a contiguous
You are given a two-dimensional mat[][] of size n*m containing English alphabets and a string word. Check if the word exists on the mat. The word
An array is considered special if every pair of its adjacent elements contains two numbers with different parity. You are given an
You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled from 1 to n. You are also
Implement the function power(b, e), which calculates b raised to the power of e (i.e. be). Examples: Input: b = 3.00000, e = 5Output: 243.00000
In this problem, a tree is an undirected graph that is connected and has no cycles. You are given a graph that