Data Structure
Java
Python
HTML
Interview Preparation
Interview Prep
Tutorials
Tracks
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
Misc
7.7K+ articles
Mathematical
5.1K+ articles
Arrays
4.2K+ articles
Strings
2.1K+ articles
Greedy
1.4K+ articles
Sorting
1.1K+ articles
Dynamic Programming
1.1K+ articles
Searching
1.0K+ articles
Tree
911+ articles
DSA
20.3K+ posts
Recent Articles
Popular Articles
Penalty scoring
Last Updated: 11 December 2025
Divyansh, while attending Geeks Classes, aims to solve all weekly contest problems. However, due to wrong submissions, he sometimes receives penalties, and each penalty re...
read more
DSA
Number of possible squares
Last Updated: 11 December 2025
Given an N × N chessboard. Find the total number of distinct squares that can be formed on this board.Note: A square can be of any size: 1×1, 2×2, 3×3, …, up to N×N.Exampl...
read more
DSA
DSA
Good Subsequence
Last Updated: 11 December 2025
Given a strictly increasing integer arrayarr[]. The subsequence of the given array is calledgoodif it satisfies the following two conditions:The elements of the subsequenc...
read more
DSA
Prime Range Query
Last Updated: 11 December 2025
Given an array of integers A[] and a list of queries Q[]. Each query specifies a range [L, R] (1-based indices) in the array.For each query, our task is to determine how m...
read more
DSA
Sum of distance from each node
Last Updated: 11 December 2025
Given a connected tree of N nodes, numbered from 1 to N. Since it is a tree, there is exactly one simple path between any two nodes. For every node in the tree, your task ...
read more
DSA
Encode and Decode Strings
Last Updated: 11 December 2025
We are given an array of strings s[], and our task is to design an encoding–decoding system that allows this data to be safely transmitted over a network. We must implemen...
read more
DSA
Array Queries
Last Updated: 11 December 2025
Given an array arr[] and a list of queries q[], where each query specifies an operation to perform on the array, implement the class ArrayQueries that supports the followi...
read more
DSA
Magic Balls over Hills
Last Updated: 11 December 2025
Geekland contains a sequence of villages, each with a hill of a certain height. Geek must answer queries about launching an enchanted ball from one village to another.Geek...
read more
DSA
Min Queries
Last Updated: 11 December 2025
Given an integer array A[] and q queries. Each query contains an integer x.For each query, Find the minimum index i such that A[i] ≥ x, and then decrease the value at posi...
read more
DSA
Get Value from Parenthesis
Last Updated: 11 December 2025
We are given a parenthesis string s consisting of '(', ')', and integers (where each integer lies in the range -10⁹ to 10⁹). Our task is to evaluate the value of this stri...
read more
DSA
NextGen Towers
Last Updated: 10 December 2025
Given N towers numbered from 0 to N - 1, and M wires. Each wire is represented by connections[i][0] and connections[i][1], indicating that these two towers are directly co...
read more
DSA
Evaluate the Expression
Last Updated: 10 December 2025
Given 3 integersa, b and c, Find the minimum value ofxsuch that the expression((a|x) (b|x)) = cholds, else, return-1.Note: Here '|' means bitwise OR and '' means bitwise ...
read more
DSA
Maximize tree height
Last Updated: 11 December 2025
Given an integer array arr[] tree heights and you need to collect at least B meters of wood by cutting them. You choose a height H, and every tree taller than H is cut dow...
read more
DSA
Coprime Counting
Last Updated: 10 December 2025
You are given an integer n. Determine how many pairs of integers (A, B) satisfy the conditions:0 = A = B = ngcd(A, B) = 1Examples:Input: 1Output: 2Explanation: Two pairs t...
read more
DSA
Generating Numbers
Last Updated: 10 December 2025
Given a positive integer N, generate the first N positive integers that can be expressed in the form 2i * 3j * 5k * 7l where i, j, k, l ≥ 0 are integers. Find these first ...
read more
DSA
1
2
3
4
...
1356