[Geeks for Geeks] Two numbers with odd occurrences

Two numbers with odd occurrences

Given an unsorted array, arr[] of size N and that contains even number of occurrences for all numbers except two numbers. Find the two numbers in decreasing order which has odd occurrences.

Read more
[Geeks for Geeks] Flood fill Algorithm

Flood fill Algorithm

An image is represented by a 2-D array of integers, each integer representing the pixel value of the image.

Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value newColor, “flood fill” the image.

To perform a “flood fill”, consider the starting pixel, plus any pixels connected 4-directionally to the starting pixel of the same color as the starting pixel, plus any pixels connected 4-directionally to those pixels (also with the same color as the starting pixel), and so on. Replace the color of all of the aforementioned pixels with the newColor.

Read more
[Geeks for Geeks] Jumping Numbers

Jumping Numbers

Given a positive number X. Find the largest Jumping Number smaller than or equal to X.
Jumping Number: A number is called Jumping Number if all adjacent digits in it differ by only 1. All single digit numbers are considered as Jumping Numbers. For example 7, 8987 and 4343456 are Jumping numbers but 796 and 89098 are not.

Read more
[AlgoExpert] Invert Binary TreeRead more
[AlgoExpert] Reconstruct BSTRead more
[AlgoExpert] Binary Tree DiameterRead more
[AlgoExpert] Find SuccessorRead more
[AlgoExpert] Height Balanced Binary TreeRead more
[AlgoExpert] Max Subset Sum No AdjacentRead more
[AlgoExpert] Number Of Ways To Traverse GraphRead more