Courses
Tutorials
Interview Prep
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
912+ articles
DSA
20.6K+ posts
Recent Articles
Minimum Weight Subtree Connecting Given Nodes
Last Updated: 06 October 2026
Given a tree with n nodes numbered from 1 to n, represented by a 2D array edges[][] of size n-1, where edges[i] = [a, b] denotes an undirected edge between nodes a and b. ...
read more
DSA
Program to Validate an IPv6 Address
Last Updated: 03 October 2026
Given a string s in the form of an IPv6 Address, the task is to validate an IPv6 Address. If it is valid, return true; otherwise, return false.An IPv6 address is a unique ...
read more
DSA
IPC
Smallest in Array
Last Updated: 03 October 2026
Given an array of integers arr[]. Find the minimum element.Examples:Input: arr[] = [1, 2, 3, 4]Output: 1Explanation: The smallest element in the array is 1.Input: arr[] = ...
read more
DSA
Arrays
Power of a 2 x 2 Binary Matrix
Last Updated: 02 October 2026
Given a 2 × 2 matrix: A = [[1, 1], [1, 0]] and an integer n. Compute the matrix An. Return the value of the element at position A[1][0] (i.e., second row, first column) mo...
read more
DSA
R-Matrix
Maximum Level in Binary Tree
Last Updated: 02 October 2026
Given a binary tree, find its maximum level (the deepest level that contains at least one node). Root is considered at level 1.Examples:Input: root = [1, 3, 2, 4, N, N, N]...
read more
DSA
Trees
Max Sum Subarray with One Square Allowed
Last Updated: 01 October 2026
Given an integer array arr[], find the maximum sum subarray by squaring at most one element.Examples:Input: arr[] = [-1, -2, 3, -2, 3]Output: 10Explanation: The subarray ...
read more
DSA
STL
MSc
Count Path Visits for Each Node for Given Path Queries
Last Updated: 03 October 2026
A tree has n nodes numbered 1 to n, connected by n - 1 edges given as edges[][], where edges[i] = [u, v] indicates a direct edge between nodes u and v.You are also given q...
read more
DSA
Beautiful String Queries
Last Updated: 30 September 2026
A string s is called beautiful if the length of its compressed form t is strictly less than the length of s. The compressed form t of a string s is obtained by the followi...
read more
DSA
Minimum Operation Query
Last Updated: 03 October 2026
Given a string s of lowercase English letters and an array queries[][], where each query is of the form [l, r]. For each query, find the minimum number of operations requi...
read more
DSA
Count People Reaching Required Tower Height
Last Updated: 03 October 2026
Given three arrays heights[], jumps[] and queries[], where:heights[i] is the height of the ith tower.jumps[i] is the maximum number of jumps allowed for the ith person.The...
read more
DSA
Subtree Sum Queries
Last Updated: 03 October 2026
Given a tree with n nodes numbered 1 to n, rooted at node 1. The tree is given as n - 1 undirected edges in edges[][], where edges[i] = [ui, vi] is an edge between the nod...
read more
DSA
Connected Pairs in Bitwise AND Graph
Last Updated: 03 October 2026
A graph has n nodes, where node i has weight w[i]. An undirected edge exists between nodes i and j (i ≠ j) if and only if w[i] w[j] ≠ 0, where is the bitwise AND operato...
read more
DSA
Design Data Structure with Insert and Replace
Last Updated: 05 October 2026
Design a data structure that initially contains no elements and supports the following operations:insert(x): Inserts the integer x at the end of the data structure.print()...
read more
DSA
cpp-vector
java-LinkedList
Count Equidistant DNA Sequences
Last Updated: 30 September 2026
Given two DNA sequences s1 and s2, each of length n, consisting of characters from the set {A, T, G, C}, find the number of DNA sequences s3 of length n such that the Hamm...
read more
DSA
Number Bridge Pattern
Last Updated: 04 October 2026
Given an integer n, print a number bridge pattern where the ith row contains numbers from 1 to i in increasing order followed by numbers from i to 1 in decreasing order, p...
read more
DSA
pattern-printing
1
2
3
4
...
1373