Tutorials
Courses
Go Premium
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.1K+ articles
Misc
7.8K+ 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
909+ articles
DSA
20.2K+ posts
Recent Articles
Popular Articles
Understanding Prefix Sums
Last Updated: 28 July 2025
In programming, prefix sum arrays are a simple and powerful technique. They make it easier to solve problems that involve finding the sum of numbers between two points in ...
read more
DSA
Range-Based Count of X in Sorted Array
Last Updated: 01 August 2025
Given a sorted array arr[] and a list of queries represented as a 2D array queries[][]. Each query is a triplet of the form [l, r, x], where l and r are indices in the arr...
read more
DSA
Count Frequency of an Element in a Given Range
Last Updated: 16 July 2025
Given an array arr[] of integers and a 2D array queries[][], where each queries[i] contains three integers: l, r, and x. For each query, determine how many times the eleme...
read more
DSA
Binary Search
Maximum Non-Overlapping Odd Palindrome Sum
Last Updated: 31 July 2025
Given a string s consisting of lowercase English letters, find the maximum possible sum of the lengths of any two non-empty and non-overlapping palindromic substrings of o...
read more
DSA
strings
Tywin's War Strategy
Last Updated: 18 July 2025
Given an array arr[] of length n, where arr[i] is the number of soldiers in the i-th troop, and an integer k. A troop is called lucky if its soldier count is a multiple of...
read more
DSA
Minimize Difference
Last Updated: 24 July 2025
Given an array arr[] of strings, where each string represents a time in 24-hour format ("HH:MM:SS"), find the minimum absolute difference in seconds between any two time v...
read more
DSA
strings
Longest Periodic Proper Prefix
Last Updated: 04 August 2025
Given a string s, find the length of the longest proper prefix such that repeating this prefix one or more times forms a string that contains s as a prefix. If no such pre...
read more
DSA
Balance Consonant and Vowels Ratio
Last Updated: 11 July 2025
You are given an array of strings arr[], where each string contains only lowercase English letters. Count the number of contiguous subarrays (i.e., one or more consecutive...
read more
DSA
DSA
Powerful Integers
Last Updated: 05 July 2025
You are given a 2D integer array intervals[][] of length n and integer k, where each intervals[i] = [start, end] represents a closed interval (i.e., all integers from star...
read more
DSA
prefix-sum
DSA
ASCII Range Sum
Last Updated: 28 July 2025
Given a string s consisting of lowercase English letters, identify all characters whose first and last occurrences are at different positions.For each such character, comp...
read more
DSA
prefix-sum
strings
DSA
Local Min and Max Sequence Ordering
Last Updated: 23 July 2025
Given an integer array arr[] representing a sequence of elevations, Return an array that includes:The first and last elements of the array.Every element where the trend of...
read more
DSA
Counting Even-Frequency Characters in a String
Last Updated: 26 July 2025
Given a string s consist of lowercase english letters, count how many distinct characters appear an even number of times.Examples: Input: s = "abacaba"Output: 2Explanation...
read more
DSA
Candidates with majority vote
Last Updated: 27 July 2025
Given an array arr[] of positive integers where each element represents a vote for a candidate, Find all candidates who receive more than ⌊n/3⌋ of the total votes. The res...
read more
DSA
Floor and Ceil of Integer Division
Last Updated: 14 July 2025
Given two integers a and b (where b ≠ 0). The objective is to find:• The floor of the division a / b, denoted as ⌊a / b⌋ — the greatest integer less than or equal to a / b...
read more
DSA
Maths
Must‑Have Digit
Last Updated: 14 July 2025
Given an integernrepresenting the number of digits, and an arrayarr[] of digits (0–9), count how many n‑digit positive integers can be formed such that at least one digit ...
read more
DSA
1
2
3
4
...
1348
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !