8 captures
30 Apr 2025 - 29 Sep 2026
Mar
APR
May
30
2024
2025
2026
success
fail
About this capture
TIMESTAMPS
The Wayback Machine - https://web.archive.org/web/20250430151110/https://www.geeksforgeeks.org/user/sahil_bansall/
Courses
Tutorials
Practice
Contests
Data Structure
Java
Python
HTML
Interview Preparation
person_outline
Profile
description
Contributions
school
Colleges
business
Companies
people_outline
Campus Ambassadors
sahil_bansall
Current POTD Streak
STREAK
00
/1367
days
Longest streak/Global longest streak
Institution
Punjab Engineering College (PEC), Chandigarh
28 Rank
Institute Rank
Language Used
C++, Java, C
Coding Score
1545
Problem Solved
924
Contest Rating
__
Apply for Campus Ambassador
9753 points
Contributor
9753 points
Contributor
1 Point
Proficient
Proficient
100 Point
Scholar
Scholar
1k Point
Master
Master
10k Point
Ace
Ace
50k Point
Find Your Place Among the Best
Explore Our Badge Program and Start Writing.
Start writing
How Badges Work
0 submissions in current year
Current
2024
2023
2022
2021
2020
2019
2018
2017
January
February
March
April
SCHOOL (8)
BASIC (303)
EASY (355)
MEDIUM (234)
HARD (24)
Sorting Elements of an Array by Frequency
Find the Maximum sum
Shivani hates Consecutive numbers
SP - Special Subsequences
Sort a linked list of 0s, 1s and 2s
Add Number Linked Lists
Add 1 to a Linked List Number
Merge 2 sorted linked list in reverse order
Linked List in Zig-Zag fashion
Detect Loop in linked list
Count BST nodes that lie in a given range
Merge Sort
Quick Sort
Binary Tree from Inorder and Postorder
Bottom View of Binary Tree
Intersection in Y Shaped Lists
Diameter of a Binary Tree
Merge two sorted linked lists
Add all greater values to every node in a BST
Sum Tree
Construct Binary Tree from Parent Array
Connect Nodes of Levels
Flattening a Linked List
Diagonal Tree Traversal
Tree Boundary Traversal
Delete a node from BST
Directed Graph Cycle
LCA in Binary Tree
Maximum difference between node and its ancestor
Absolute List Sorting
Two Stacks in an Array
The Celebrity Problem
Largest subarray with 0 sum
Vertical Tree Traversal
Merge K sorted linked lists
Find the number of islands
Get Min from Stack
Serialize and deserialize a binary tree
Gas Station
Wildcard Pattern Matching
Linked List to Binary Tree
Generate IP Addresses
Check if subtree
Is Binary Tree Heap
Validate an IP Address
Remove loop in Linked List
Largest BST
Interleaved Strings
Implement Atoi
Maximum Difference
Palindrome Linked List
Closest in BST
Delete keys in a Linked list
Merge two BST 's
Count distinct elements in every window
Print Nodes having K leaves
Find triplets with zero sum
Sort a stack
Top View of Binary Tree
k-th Smallest in BST
Find Common Nodes in two BSTs
Polynomial Addition
Delete nodes greater than k
Union of Two Linked Lists
Ancestors in Binary Tree
Pair Sum in BST
Root to Leaf Paths
Counting elements in two arrays
K Sum Paths
Foldable Binary Tree
Leftmost and rightmost nodes of binary tree
Modify Linked List-1
Construct Tree from Inorder & Preorder
Construct tree from Inorder and LevelOrder
Vertical sum
Pairs violating BST property
Isomorphic Trees
Diagonal sum in binary tree
Check if two Nodes are Cousins
ZigZag Tree Traversal
Count Number of SubTrees having given Sum
Vertical Width of a Binary Tree
C++ Generic sort
Count total set bits
Smallest Positive Missing
Rotate and delete
Rearrange Array Alternately
Kadane's Algorithm
Majority Element
Count Inversions
Two Repeated Elements
Unique BST's
Indexes of Subarray Sum
Count the number of possible triangles
Triplet Sum in Array
Boolean Matrix
Spirally traversing a matrix
Unit Area of largest region of 1's
Longest Consecutive Subsequence
Case-specific Sorting of Strings
Postfix Evaluation
Stock span problem
Next Greater Element
Infix to Postfix
K Sized Subarray Maximum
Kth smallest element
Activity Selection
Fractional Knapsack
Job Sequencing Problem
Largest number in K swaps
Combination Sum
Stickler Thief
Ways to Reach the n'th Stair
Minimum number of jumps
Longest Increasing Subsequence
Longest Common Subsequence
0 - 1 Knapsack Problem
Sort according to an Array
Allocate Minimum Pages
X Total Shapes
Zero Sum Subarrays
Implement Trie
Most frequent word in an array of strings
Count subsequences of type a^i, b^j, c^k
Print Anagrams Together
Overlapping Intervals
4 Sum - All Quadruples
Excel Sheet | Part - 1
Sort 0s, 1s and 2s
Paths to reach origin
Pascal Triangle
Maximum Index
Large Factorial
Maximize Number of 1's
Sum of Middle elements of two sorted arrays
Pair array product sum
Single Among Doubles in a Sorted
Consecutive 1's not allowed
Count Occurences of Anagrams
Single Among Doubles
Pythagorean Triplet
Mr Modulo and Pairs
Pair Sum Closest to 0
Search in Rotated Sorted Array
Maximum Intervals Overlap
Max absolute difference
Form the Largest Number
Add Binary Strings
Maximum Product Subarray
Row with max 1s
Max value after m range operation
Column name from a given column number
Design a tiny URL or URL shortener
Form a palindrome
Nuts and Bolts Problem
Rotate a Matrix
Maximum distinct elements after removing K elements
Transform String
Count the Reversals
Sum of two large numbers
Max Sum without Adjacents
Factorials of large numbers
Maximum length Bitonic Subarray
Shuffle integers
Reverse each word in a given string
k largest elements
Magnet Array Problem
Longest Common Substring
Smallest distinct window
Longest substring with distinct characters
Longest Palindrome in a String
Product Pair
Integer to Words
K-th element of two Arrays
Arranging the array
Possible groups
Triplets with Smaller Sum
Rod Cutting
Fill array with 1's
Longest Palindromic Subsequence
Find k-th character in string
Minimum sum
Roll the characters of a String
Minimize the Heights II
LinkedList Josephus Circle
Surpasser Count
Transform to prime
First and Last Occurrences
Palindrome in Alphanumeric String
Valid Substring
Minimum Swaps for Bracket Balancing
Permutations of a String
Combination Sum - Part 2
Closest prime number
Sum of Products
Subarrays Product Less than K
Unique Number II
Bleak Numbers
Game of XOR
Max Sum Increasing Subsequence
Coin Change (Count Ways)
Count numbers with given sum
Count ways to N'th Stair(Order does not matter)
Knapsack with Duplicate Items
nCr
Number of ways
Maximum path sum in matrix
Longest Bitonic subsequence
Count the number of ways to tile the floor of size n x m using 1 x m size tiles
Digit multiplier
Matchsticks game
Subset Sums
Number of paths
Stepping Numbers
Permutation with Spaces
Count Total Setbits
Sum of Query II
Find Prime numbers in a range
Jumping Numbers
Fraction to Repeating Decimal
Find the Safe Position
Next Permutation
Smaller on Left
How Many X's?
Rotate Each Row of Matrix K Times
Total Decoding Messages
Stream First Non-repeating
Segregate even and odd nodes in a Linked List
Largest square formed in a matrix
Transitive closure of a Graph
Replace O's with X's
Floyd Warshall
Flood fill Algorithm
Recursively Remove Adjacent Duplicates
Rotate Array
Sort String
Break the digital root code
Geek and the equation
Print Linked List
Count Linked List Nodes
Power of Four
Size of Binary Tree
Count Leaves in Binary Tree
Postorder Traversal
Implement stack using array
Queue Using Array
Add two fractions
Replace all 0's with 5
Replace all 0's with 5
Preorder Traversal
First Occurence
C++ STL | Set 1 (vector)
Sum Except First and Last
C++ STL | Set 4 (stack)
C++ STL | Set 5 (queue)
Search a node in BST
Palindromic Array
Multiply Matrices
Peak element
Minimum element in BST
Anagram of String
Is Linked List Length Even?
Identical Linked Lists
Modular Node
Triplet Family
Sum of Binary Tree
Insert in Middle of Linked List
longest substring containing '1'
Pairwise Consecutive Elements
Count Non-Leaf Nodes in Tree
Alternates in an Array
Bit Difference
Number is sparse or not
Reverse array in groups
Array Search
Sorted Array Search
Binary Array Sorting
Check if a string is Isogram or not
Binary String
Remove common characters and concatenate
Reverse a String
Keypad typing
First n Fibonacci
C++ Hello World
Find second largest element
Minimum Product of k Integers
Merge and Sort
Palindrome Array
Multiply Array
Count number of elements between two given elements in array
Sandwiched_Vowels
Minimum move to front operations
Sum of Array
Sum of Natural Numbers
Searching in an Array
ArrayList insertion
Doubling the value
Count pair sum
Print Elements of Array
Elements before which no element is bigger
Remove consonants from a string
Friendly Array
Balanced Array
Sort the Half Sorted
At least two greater elements
Farthest Index
Check Arithmetic Progression
Type of array
Sort a String
Anagram Palindrome
LinkedList Insertion
Sort The Array
LinkedList Traversal
Distinct Elements in a Stream
Alternative Sorting
Check if divisible by 11
Check if divisible by 4
Change the string
Remove all characters other than alphabets
Maximum product of two numbers
Value equal to index value
Check for subsequence
Segregate Even and Odd numbers
Odd to Even
Learning Output
Fighting the darkness
Count Pairs Odd Xor
The problem of identical arrays
Sum of alternate product
Reverse sub array
Immediate Smaller Element
Sum of distinct elements
Count the characters in each word in a given sentence
Count the characters
Uncommon characters
Swap kth elements
Reversing the vowels
Rock Paper Scissors!
Shortest direction
Extract the integers
Fake Profile
Smaller and Larger
A guy with a mental problem
Remove repeated digits in a given number
Remove Spaces
Repeated Character
Replace the Bit
Reverse a string with spaces intact
First 1 in a Sorted Binary Array
Length of Last word
Missing number in shuffled array
Max and Min Product from 2 Arrays
The Penalty Shootout
Elements in the Range
Display longest name
Find element at a given Index
Last index of One
URLify a given string
First K natural numbers
Sort the string in descending order
Merge two strings
Good String
Crazy String
String with numbers at its end
Substrings with same first and last characters
Last duplicate element in a sorted array
Largest Element in Array
Rotate Array by One
Game with nos
Exceptionally odd
Ishaan Loves Chocolates
Split Strings
Array Subset
Wrong Ball
Rotating an Array
Minimum number to form the sum even
C++ Strings
Java Streams Sum
Java Streams Max
Java Streams Average
Java Streams Filter
Count of smaller elements
First and Second Smallests
Min and Max in Array
Average Count Array
Positive and negative elements
Extract Maximum
Smallest number repeating K times
Boolean String Value
Last index of a character in the string
Good or Bad string
Remove character
Minimum number of flipped bits
No of Carry Operations
Magical String[Duplicate Problem]
Difference between highest and lowest occurrence
GCD of Array
GCD of two numbers
Find unique element
C++ if-else (Decision Making)
Addition of Two Numbers
1s Complement
Odd or Even
Check set bits
C++ Operators (Relational) | Set 2
C++ Switch Case Statement
XOR of all elements
C++ Operators | Set 1 (Arithmetic)
The OR Gate
The AND Gate
Smallest Missing in Sorted Array
Binary representation
Check for Power
Find position of set bit
Set kth bit
Check if divisible by 36
Odd Divisors
Vowel or Not
The XOR Gate
Maximize OR
Smallest power of 2 greater than or equal to n
Sum of Consecutives
Find the fine
Strong Numbers
Set all odd bits
Check if divisible by 5
Check perfect square
LCM And GCD
nth digit of Fibonacci
LCM of given array elements
Small Factorial
House Robber
Mean of an Array
Cube root of a number
Shortest un-ordered subarray
Message Spreading
Repeated IDs
C++ Data Types
Find the remainder
Area of a triangle
Fibonacci to N
Krishnamurthy number
Product Sum
Strong Numbers
Median of an Array
Sum Of Digits
Find N-th term in the series
Celsius to Fahrenheit Conversion
Factorial Number
Factorial
Automorphic Number
Sum of odd and even elements
Number of divisors
Parity of unsigned integer
Sum of Digit is Palindrome or not
Perfect Number
Sum of an AP
Greatest of three numbers
Sum of AP series
Pairs with given XOR
Sum of GP
Simple Interest
Reverse digits
Binary number to decimal number
Finger Game
Prime Number
Absolute Difference of 1
Closest Number
Check squares
Check if two given circles touch each other
Series AP
Common Divisors
Sum of divisors
Floyd's triangle
Generate all cyclic permutations of a number
Distance between 2 points
Area of Rectangle, Right Angled Triangle and Circle
Angle between hour and minute hand
Sum of elements in a matrix
Count zero
Check if the door is open or closed
Find sum of even factors of a number
Sum of first n terms
Tidy Number
Compound Interest
Multiplication Table
Pronic Number
G.F Series
Ladoo problem
Sum of all subsets formed by first N natural numbers
Print 1 to n without using loops
Disarium Number
Jumping Geek
Min value of x
Count Squares
Maximum distance
Matching Pair
Check if the number is Fibonacci
Check if date is valid
Anshuman's Favourite Number
Repeated sum of digits
Sum of Digit Modified
Sum of Digits Divisibility
K-th distinct element
Narcissistic number
Print the Kth Digit
Numbers containing 0's from 1 to N
Swap two numbers
Unique Numbers
Height of Heap
12 hour clock addition
Composite Series
Number of Integer solutions
Repetitive Addition Of Digits
Half N by M
Pairs of prime number
Pattern Jumping
Evaluate the expression
India's unique railway tracks
Perfect Squares in a Range
Point lies or not
Rectangle Number
Make a Distinct Digit Array
Perfect Cubes in a Range
Minimum difference pair
The Lazy Caterer's Problem
Roots of Quadratic Equation
Surface Area and Volume of Cuboid
Thief trying to escape
Finding Position
nPr
Squares in a Matrix
Parallel or Perpendicular?
Multiply 2 matrices
Sum of primes
Encoding names
Student record
Replace by X
String Ignorance
Sahil loves gfg
Sahil love good scorer
Smriti's String
Special path
SP - Palindrome Family
Geeks and the test
Geek and the base
SP - Stack Design
Reverse a linked list
Frequency in a Linked List
Delete N nodes after M nodes of a linked list
Pairwise swap elements of a linked list
Node at a given index in linked list
Linked list of strings forms a palindrome
Remove duplicates from an unsorted linked list
Inorder Traversal
Bubble Sort
Selection Sort
Check for BST
Right View of Binary Tree
K distance from root
Mirror Tree
Two Mirror Trees
Maximum Width of Tree
Delete without head pointer
Height of Binary Tree
Balanced Tree Check
Kth from End of Linked List
Middle of a Linked List
Left View of Binary Tree
Delete Middle of Linked List
Decimal Equivalent of Binary Linked List
Transform to Sum Tree
Queue using two Stacks
Remove Duplicates from a Sorted Linked List
Stack using two queues
Level Order in spiral form
Reverse Level Order Traversal
DFS of Graph
Insert a node in a BST
BFS of graph
Identical Trees
Root to leaf path sum
Square Root
Nodes without a Sibling
Postorder from Inorder and Preorder
Lowest Common Ancestor in a BST
Binary Search
Run Length Encoding
Remove Duplicates Sorted Array
Level Order Line by Line
BST Keys in a Range
Minimum Depth of a Binary Tree
Odd even level difference
Binary Tree to BST
Equilibrium index of an array
Unique rows in boolean matrix
Remove every k'th node
Multiply two linked lists
Josephus problem
Expression Tree
Find perimeter of shapes
Delete in a Singly Linked List
Kth largest element in BST
Max Level Sum in Binary Tree
Level order traversal
Inorder Successor in BST
Index of an Extra Element
Intersection of Two Linked Lists
Insert in a Sorted List
Level of a Node in Binary Tree
Sum of leaf nodes in BST
Max and min element in Binary Tree
Reverse Using Stack
Triplet with 0 sum in BST
Symmetric Tree
Delete Alternate Nodes
Find the Sum of Last N nodes of the Linked List
Count Pairs whose sum is equal to X
Find length of Loop
Median of BST
Find n/k th node in Linked list
Maximum Pairwise Computed Value
Queue Reversal
Reverse first K of a Queue
Height of Spiral Tree
Magical Number
Sum of Leaf Nodes
Sum of Right Leaf Nodes
Sum of Left Leaf Nodes
Closest Neighbour in BST
Sum of Leaf Nodes at Min Level
Tilt of Binary Tree
Delete Mid of a Stack
Product of an Array
Start Coding - Java
The New Line - Java
Data Types - Java
Taking input - Java
Learn to Comment - Java
Precise Format - Java
logical Operators - Java
Bitwise Operators - Java
For Loop- primeCheck - Java
While loop- printTable - Java
Step by Step Condition - Java
Count Odd Even - Java
Consonants and Vowels check - Java
First Set Bit
Rightmost different bit
K-th Bit is Set or Not
Longest Consecutive 1's
Power of 2
Wave Array
Frequencies in a Limited Array
Equilibrium Point
Array Leaders
Floor in a Sorted Array
Minimum Number in a sorted rotated array
Sort by Absolute Difference
Print adjacency list
Print Matrix in snake Pattern
Transpose of Matrix
Rotate by 90 degree
Anagram
Winner of an election
String Rotated by 2 Places
Reverse Words
Minimum indexed character
Non Repeating Character
Parenthesis Checker
Generate Binary Numbers
Minimum Cost of ropes
N meetings in one room
Count number of hops
First Repeating Element
Union of Arrays with Duplicates
Check Equal Arrays
Numbers containing 1, 2 and 3
Missing in Array
Product array puzzle
Intersection of Arrays with Distinct
Excel Sheet | Part - 2
Adding One
Max Value Permutation
Missing And Repeating
Buildings receiving sunlight
Find Index
Non-Repeating Element
Pairs of equals Sum
Max value
Count the elements
Maximum Gap
Find Kth Rotation
Professor and Parties
Left or Right Positioned Array
Pairs which are Divisible by 4
k modulus array element
Maximum AND Value
Maximize sum after K negations
Adding Ones
ArrayList Operations
ArrayList Iterate Front to Back
Equal Point in Sorted Array
Common in 3 Sorted Arrays
Good Pairs
First Come First Serve
Sorted and Rotated Minimum
Maximum no of 1's row
Maximum Neighbours In ArrayList
Sum of elements between k1'th and k2'th smallest elements
Next greater number set digits
Search in a Row-Column sorted matrix
Move All Zeroes to End
String Duplicates Removal
Min sum formed by digits
Minimize the sum of product
Missing number
Move all negative elements to end
String Manipulation
Chocolate Distribution Problem
Minimum Distinct Ids
Count the triplets
Find Pair Given Difference
Part Sort
Permutations in array
Pair with greatest product in array
Form a Triangle
Finding Number
Drive the car
Next Greater Even Number
Swap and Maximize
Minimize Difference in Task Priorities
Bitonic Point
Find Duplicate Element
Left most and right most index
Smallest subarray with sum greater than x
Amend The Sentence
Single Number
Count increasing Subarrays
Alternate Positive Negative
Maximum Possible Sum of Products
1[0]1 Pattern Count
Largest Even Number
Sort the given array after applying the given equation
Check if a given string is a rotation of a palindrome
Remove Consecutive Characters
List of Smaller Elements
Kth distance
Addition of submatrix
Check if the number is balanced
Rahul a Geek
Stuffs Division
Sort in specific order
Rearrange a string
Form largest number from digits
Sherlock a Detective
Remove Duplicates
Compete the skills
Convert the string
Sorting Employees
Toppers Of Class
Sum of two numbers represented as arrays
Facing the sun
Greater on right side
Count Substrings
Difficulty of sentence
Twice Counter
Bitonic Generator Sort
Second Largest
Convert array into Zig-Zag fashion
Two Sum - Pair with Given Sum
Rotate Bits
Second most repeated string in a sequence
Check if array contains contiguous integers
Equal point in a string of brackets
Find all pairs with a given sum
Number of occurrence
Average of Prefix
Maximum repeating number
K-Pangrams
Find the left over element
Find the most frequent digit
Does array represent Heap
The Non-repetitive String
Modify the Array
Convert an array to reduced form
Three consecutive duplicates
Check if array is sorted
Consecutive Array Elements
Count even substrings
Find missing in second array
Longest Common Prefix of Strings
First Repeated Character
Prime String
Numbers with prime frequencies greater than or equal to k
Palindromic Subsequences
Special array reversal
Even and odd elements at even and odd positions
Meta Strings
Sum of distinct elements for a limited range
Maximum difference Indexes
Counts Zeros Xor Pairs
Two sum -Pairs with 0 Sum
Sum of f(a[i], a[j]) over all pairs in an array of n integers
Segregate 0s and 1s
Positive distinct count
Maximum number of zeroes
Print an array in Pendulum Arrangement
Three Great Candidates
Digits in a set
At Least K Occurrences
Element with left side smaller and right side greater
Ishaan and Sticks
Find the closest pair from two arrays
Common Divisor
Merging two unsorted arrays in sorted order
Count the Zeros
Distinct absolute array elements
Transform the array
Total distance travelled in an array
Four Elements
Palindrome String
Total count
Left out candies
Chocolate Station
Smallest greater elements in whole array
Pangram Strings
Pattern Searching
Print Bracket Number
Easy string
Minimum changes to make all substrings distinct
Generate binary string
Is Binary Number Multiple of 3
Minimum Operations
Divisibility by 8
Number of 1 Bits
Find the Highest number
Armstrong Numbers
Pairs with Positive Negative values
Remove minimum number of elements
Reverse Bits
Max Sum Subarray of size K
Nth Fibonacci Number
Number of factors
Star elements
Toggle bits in the given range
Game of Nim
Element that appears once where every element occurs twice
Party of Couples
Count numbers
Shortest path from 1 to n
Compute (a*b)%c
Find sum of divisors
Sieve of Eratosthenes
Magic Number
Count numbers containing 4
Exponentiation (Set 2)
Assign Mice Holes
Reach the Nth point
Nearest Perfect Square
Number Of Open Doors
Number of Groups
Perfect Numbers
Pair cube count
Nth item through sum
Palindrome numbers
Maximum height of the staircase
Adjacents are not allowed
Maximize Toys
Number that are not divisible
Carry counter
Rectangles in N*N Board
Squares in N*N Chessboard
Trailing zeroes in factorial
Find the minimum time
Sum of all prime numbers between 1 and n
Series GP
Total number of Strings
Product of two digit numbers
Least Prime Factor
Prime Factors
Sum of product of all pairs
Rotate a Matrix by 180 Counterclockwise
Row with Minimum 1s
Boundary Elements of Matrix
Prime number of set bits
Inorder Traversal and BST
Overlapping rectangles
Print Pattern
Array to BST
Sum of dependencies in a graph
Count all possible paths from top left to bottom right
Linked List Group Reverse
Reorder List
Binary Tree to DLL
Clone List with Next and Random
Min distance between two given nodes of a Binary Tree
Max rectangle
Nodes at given distance in binary tree
Fixing Two nodes of a BST
Max Path Sum 2 Special Nodes
Trapping Rain Water
Histogram Max Rectangular Area
Max of min for every window size
Find median in a stream
Solve the Sudoku
Merge Without Extra Space
Count Pairs in an Array
The Painter's Partition Problem-II
Ugly Numbers
Count Smaller elements
RegEx matching
All numbers with specific difference
Edit Distance
Matrix Chain Multiplication
Longest valid Parentheses
Reverse an Array
Maximum and Minimum Of Array Elements
a^b (Set 1)-(ambiguous)
All divisors of a natural number
Sum of Digits Multiple - copy
Search in a 2D Matrix
Arrays (Sum of array)
Print string N times
close
S
person_outline
Profile
description
Contributions
school
Colleges
business
Companies
people_outline
Campus Ambassadors
✕