gfg-potd

Smallest number

gfg-potd

Given two integers s and d. The task is to find the smallest number such that the sum of its digits is s and the […]

Segregate 0s and 1s

gfg-potd

Given an array arr consisting of only 0‘s and 1‘s in random order. Modify the array in-place to segregate 0s onto the left side and 1s

Root to leaf path sum

gfg-potd

Given a binary tree and an integer target, check whether there is a root-to-leaf path with its sum as target. Examples : Input: tree

Closest Three Sum

gfg-potd

Given an array, arr of integers, and another number target, find three integers in the array such that their sum is closest to

Ancestors in Binary Tree

gfg-potd

Given a Binary Tree and an integer target. Find all the ancestors of the given target. Note: The ancestor of node x is node y, which is

Duplicate Subtrees

gfg-potd

Given a binary tree, your task is to find all duplicate subtrees from the given binary tree. Duplicate Subtree : Two

Scroll to Top