Courses
Tutorials
Jobs
Practice
Contests
Data Structure
Java
Python
HTML
Interview Preparation
Trending Now
DSA
Web Tech
Foundational Courses
Data Science
Practice Problem
Python
Machine Learning
JavaScript
System Design
Django
DevOps Tutorial
Java
C
C++
ReactJS
NodeJS
CP Live
Aptitude
Puzzles
Projects
GBlog
Three 90 Challenge: Bigger and Better
As we transit into the new phase, it's essential to fuel our inner drive for success. On popular demand, GeeksforGeeks is happy to announce that we are back with the Thre...
Read More
What is Motherboard?
In a computer system, the motherboard is a main printed circuit. It is also called the main circuit board or mainboard. It includes several components on a single platform...
Read More
School Programming
Picked
School Learning
Class 6
Reduce a number to 1 by performing given operations | Set 3
Given an integer N, the task is to find the number of steps required to reduce the given number N to 1 by performing the following operations:If the number is a power of 2...
Read More
Bit Magic
setBitCount
Mathematical
binary-representation
maths-power
DSA
Maximum path sum from top left to bottom right of a matrix passing through one of the given cells
Given a matrix mat[][] of dimensions N * M and a set of coordinates of cell coordinates[][] of size Q, the task is to find the maximum sum of a path from the top-left cell...
Read More
Misc
Dynamic Programming
Mathematical
Matrix
DSA
Count of sets possible using integers from a range [2, N] using given operations that are in Equivalence Relation
Given an integer N, repeatedly choose two distinct integers from the range 2 to N and if their GCD is found to be greater than 1, insert them into the same set, as long as...
Read More
Mathematical
sieve
Prime Number
DSA
Sort an array having first N elements sorted and last M elements are unsorted
Given two positive integers, N and M, and an array arr[ ] consisting of (N + M) integers such that the first N elements are sorted in ascending order and the last M elemen...
Read More
Arrays
Sorting
Merge Sort
array-merge
DSA
Efficient method to store a Lower Triangular Matrix using Column-major mapping
Given a lower triangular matrix Mat[][], the task is to store the matrix using column-major mapping.Lower Triangular Matrix: A Lower Triangular Matrix is a square matrix i...
Read More
Algorithms
Analysis of Algorithms
Matrix
C Language
C++
Data Structures
CS - Placements
Arrays
C Programs
C++ Programs
DSA
C/C++ Puzzles
Rotate a matrix clockwise by 90 degree without using any extra space | Set 3
Given a rectangular matrix mat[][] with N rows and M columns, the task is to rotate the matrix by 90 degrees in a clockwise direction without using extra space.Examples:In...
Read More
Arrays
Matrix
rotation
cpp-vector
C++ Programs
DSA
Absolute difference between floor of Array sum divided by X and floor sum of every Array element when divided by X
Given an array A[] and a positive integer X. The task is to find the absolute difference between the floor of the total sum divided by X and the sum of the floor of each e...
Read More
Mathematical
Arrays
Maths
DSA
Print all Hamiltonian Cycles in an Undirected Graph
Given an undirected Graph consisting of N nodes in the form of an adjacency matrix graph[][] of size N*N, the task is to print all Hamiltonian cycles possible in the given...
Read More
Graph
Java
Backtracking
graph-connectivity
Recursion
Data Structures
Graph Traversals
graph-cycle
DSA
Maximum frequency of any array element possible by exactly K increments
Given an array arr[] consisting of N positive integers and an integer K, the task is to find the highest frequency of any array element after performing exactly K incremen...
Read More
Arrays
Greedy
Sorting
Mathematical
sliding-window
two-pointer-algorithm
DSA
Find elements larger than half of the elements in an array | Set 2
Given an array arr[] consisting of N positive integers, the task is to find the elements which are greater than at least half of the array elements.Examples:Input: arr[] =...
Read More
Arrays
Searching
Mathematical
Hash
frequency-counting
DSA
Generate a permutation of first N natural numbers from an array of differences between adjacent elements
Given an array arr[] consisting of (N - 1), the task is to construct a permutation array P[] consisting of the first N Natural Numbers such that arr[i] = (P[i +1] - P[i])....
Read More
Arrays
Misc
Mathematical
Hash
permutation
HashSet
Natural Numbers
DSA
Check if sum of digits in the left half is divisible by sum of digits in the right half in the largest permutation of N
Given a positive integer N, the task is to maximize the integer N by rearranging the digits and check if the sum of the left half digits is divisible by the sum of the rig...
Read More
Strings
Mathematical
number-digits
Number Divisibility
DSA
Convert X into Y by repeatedly multiplying X with 2 or appending 1 at the end
Given two positive integers X and Y, the task is to check if it is possible to convert the number X into Y, either by multiplying X by 2 or appending 1 at the end of X. If...
Read More
Greedy
Mathematical
Competitive Programming
number-digits
School Programming
DSA
Count numbers less than N whose Bitwise AND with N is zero
Given a positive integer N, the task is to count all numbers which are less than N, whose Bitwise AND of all such numbers with N is zero.Examples:Input: N = 5Output: 2Expl...
Read More
Bit Magic
setBitCount
Greedy
Mathematical
Bitwise-AND
DSA
1
...
5835
5836
5837
...
11256