Delete Nodes And Return Forest
Problem Given a binary tree and a list of nodes. Return the forest after removing the given node…
Longest Substring without repeating characters
Problem Given a string, find the longest substring with unique characters Sample Input &…
How to Generate Random Float numbers in Python using random and unifo…
Python comes with a built-in random module to generate random numbers. The random module provides v…
Check if directed graph is connected
Problem Given a directed graph, check if it is connected or not. Sample Input Sample O…
Nth root of M
Problem Given two integers m and n, find the value of n?m. Sample Input 2?9 Sample Ou…
Find K-th Smallest Element in BST
Problem Given a Binary Search Tree, find the k-th smallest element in the BST. Sample Input …
Find dropping point of an egg
Problem You are given a 2-D grid where each cell has a value of either 1 or -1. Each cell in the…
Find MSB in O(1)
Problem Given an integer N, find the maximum integer smaller than or equal to N, which is a powe…
Find MSB
Problem Given an integer, N. Find a maximum integer smaller than or equal to N that is the …
Find the closest pair from two arrays
Problem Given two sorted arrays and an integer X, find one number from each array such that the …
Find all symmetric pairs in an array of pairs
Problem Given an array of pairs, find all symmetric pairs in it. Symmetric pairs are two pairs (…
Find the count of distinct elements in every subarray of size k
Problem Given an array of integers and a number k. Find the count of distinct elements in every …