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
911+ articles
DSA
20.4K+ posts
Recent Articles
Popular Articles
Array Sum Except First and Last
Last Updated: 02 May 2026
You are given an array arr of numbers. Return the sum of all the elements except the first and last elements.Examples:Input: arr[] = [5, 24, 39, 60, 15, 28]Output: 138Expl...
read more
DSA
First Occurrence in Sorted
Last Updated: 27 April 2026
Given a sorted array arr[] and an integer k, find the position(0-based indexing) at which k is present in the array using binary search. If k doesn't exist in arr[] return...
read more
DSA
Print Alternate Characters of a String
Last Updated: 20 April 2026
You are given a string s, you need to print its characters at even indices(index starts at 0).Examples:Input: s = "geeksforgeeks"Output: gesogesExplanation: The even indic...
read more
DSA
1s Surrounded by 0s
Last Updated: 24 April 2026
Given an m * n binary matrix grid[][], find the total count of all cells containing 1 that are unable to move out of the grid through a path of adjacent 1s.Adjacency means...
read more
DSA
Count Connected Components
Last Updated: 21 April 2026
Given an undirected graph with V vertices and a 2D integer array edges[][], where edges[i] = [u, v] represents an undirected edge between vertex u and vertex v. Two vertic...
read more
DSA
Last Coin in a Game of Alternates
Last Updated: 08 May 2026
Given an array arr[] of size n representing the values of coins arranged in a row.Two players play a game by picking coins alternately. At each turn, a player can pick a c...
read more
DSA
Dynamic Programming Practice Problems
Last Updated: 13 April 2026
Fundamentals of DPIntroduction to DP Nth Fibonacci NumbernCrFirst n Fibonacci Ways to Reach the n'th Stair Padovan Sequence Bits CountingNth Catalan Number Number of waysM...
read more
DSA
Count Subarrays Matching Relative Pattern
Last Updated: 19 March 2026
Given an integer array arr[] of size n and another array pattern[] of size m containing values -1, 0, and 1, count the number of subarrays of size m + 1 such that the rela...
read more
DSA
Prefix and Suffix Pair Count
Last Updated: 19 March 2026
Given an array of strings arr[], count the number of pairs (i, j) such that i j and the string arr[i] is both a prefix and a suffix of the string arr[j].Examples:Input: a...
read more
DSA
strings
Input and Output in Programming
Last Updated: 26 March 2026
Input and Output (I/O) are fundamental concepts in programming. Input allows a program to receive data from the user, files, or other sources, while output allows it to di...
read more
DSA
Input and Output
Functions in programming
Last Updated: 26 March 2026
A function is a block of code that performs a specific task and can be reused whenever needed.Avoids writing the same code again and again.Makes programs simple and easy t...
read more
DSA
function
Classes and Object in Programming
Last Updated: 24 March 2026
In Data Structures, programs often work with complex data and operations that need to be organized efficiently. Object-Oriented Programming concepts like classes and objec...
read more
DSA
Class and Object
Partition Array for Maximum Sum
Last Updated: 11 March 2026
Given an integer array arr[] and an integer k, partition the array into contiguous subarrays such that each subarray has a length of at most k. After partitioning, replace...
read more
DSA
pattern-printing
Hollow Diamond Pattern
Last Updated: 11 March 2026
Given an integer N, print the pattern shown below.Examples:Input: N=5Output: Input: N=3Output: Using Nested Loops - O(n^2) Time and O(1) SpaceIterate through 2 × n − 1 r...
read more
DSA
DSA-Coding-Pattern
Print Solid Rectangle Star Pattern
Last Updated: 13 March 2026
Given two integers n and m, print a solid rectangle pattern of stars with n rows and m columns. Each row has exactly m stars.Examples:Input: n = 3, m = 5Output: Input: n...
read more
DSA
DSA-Coding-Pattern
1
2
3
4
...
1364