VOOZH
about
URL: https://www.geeksforgeeks.org/category/dsa/
⇱ DSA Archives - GeeksforGeeks
👁 geeksforgeeks
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
Probability of Survival
Last Updated: 16 June 2026
Given an n×n grid and three integers x, y, and k, a geek starts at cell [x, y]. At each move, the geek independently chooses one of the four directions - up, down, left, o...
read more
👁 article_image
DSA
Maximum Reachable Index Difference
Last Updated: 14 June 2026
Given a string s containing lowercase English letters. Start from any index containing the character 'a' and perform jump operations. In each jump operation, move to any i...
read more
DSA
Build Bit Count Array
Last Updated: 13 June 2026
Given an integer n, return an array containing the number of set bits (1s) in the binary representation of every integer in the range [0, n].Examples :Input: n = 3Output: ...
read more
DSA
Exact n Rupees After 0 or More Buyings
Last Updated: 13 June 2026
Given an integer n, find whether Geek can have exactly n rupees after buying chocolates from a shop. Geek initially has 100 rupeesThe shop sells only two types of chocolat...
read more
DSA
Connected Groups of 1s
Last Updated: 13 June 2026
Given an n × m binary grid, count the number of connected groups formed by cells containing 1. Two cells belong to the same group if they are adjacent horizontally or vert...
read more
👁 article_image
DSA
Minimum Swaps to Make Arrays Equal
Last Updated: 14 June 2026
Given two arrays a[] and b[] of the same size n, in one swap you can swap a[i] with b[i]. Find the minimum number of swaps required to make all elements of a[] equal or al...
read more
DSA
Front-Back Transformation of String
Last Updated: 13 June 2026
Given a string s consisting only of English alphabets, transform each character by replacing it with the character present at the corresponding position in the reversed En...
read more
DSA
Lexicographically Smallest and Largest
Last Updated: 13 June 2026
Given an array of strings s[]. You need to find the lexicographically smallest and largest.Examples: Input: s[] = [a , ab , abc]Output: [a, abc]Explanation: Lexicographica...
read more
DSA
Distinct Elements in a Stream
Last Updated: 14 June 2026
Given an array of integers arr[], the task is to return the no of distinct elements in every prefix. The array will have positive and negative values. positive value means...
read more
DSA
Waiting Time of the Last Consumer
Last Updated: 07 June 2026
Given two positive integers n and x, n denotes the total number of consumers, x denotes the time interval, after which a new consumer arrives. A single producer serves on...
read more
DSA
Number of Open Tabs
Last Updated: 08 June 2026
You are given an array arr[], where each element is either a tab ID or the string "END". If a tab ID appears, toggle its state (open if it's closed, or close if it's open)...
read more
DSA
Remove first and last characters
Last Updated: 07 June 2026
Given a string s, return a substring containing all characters except the first and the last. The length of the s will be greater than 2.Examples:Input: s = "Hello"Output:...
read more
DSA
The Modulo Task
Last Updated: 07 June 2026
Given an integer n. find an integer k for which n % k is the largest where 1 ≤ k n.Examples :Input: n = 3Output: 2Explanation:3 % 1 = 03 % 2 = 1So, the modulo is highest ...
read more
DSA
Numbers from 1 to n with digits in set {1, 2, 3, 4, 5}
Last Updated: 04 June 2026
Given a number n, count the numbers from 1 to n, which comprise only digits from set {1, 2, 3, 4, 5}.Examples:Input: n = 20Output: 10Explanation: The numbers whose digits ...
read more
DSA
Bitwise OR of a Binary Array
Last Updated: 04 June 2026
Given a binary array, find Bitwise OR of the given array. Examples : Input: arr[] = [1 1 1 0]Output:1Explanation:1 | 1 = 11 | 1 = 11 | 0 = 1hence output is 1Input: arr[]...
read more
DSA
1
2
3
4
...
1364