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
/
Algorithms
/
Mathematical
Mathematical
5.1K+ posts
Recent Articles
Popular Articles
Find 4 points with equal Manhattan distance between any pair
Last Updated: 23 July 2025
Given an integer N, Find 4 points in a 2D plane having integral coordinates, such that the Manhattan distance between any pair of points is equal to N.Examples:Input: N = ...
read more
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Check if X and Y can be equal in N steps by dividing them with their factors
Last Updated: 18 November 2022
Given positive integers, X, Y, and N, the task is to check whether X can be made equal to Y in exactly N operations wherein each operation:X can be divided by any of its f...
read more
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
prime-factor
Find all ranges of consecutive numbers from Array | Set -2 (using Exponential BackOff)
Last Updated: 23 July 2025
Given a sorted array arr[] consisting of N integers without any duplicates, the task is to find the ranges of consecutive numbers from that array.Examples:Input: arr[] = {...
read more
Sorting
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Arrays
Minimum steps to make X equal to Y by performing increment or bitwise OR operation
Last Updated: 23 July 2025
Given two integers X and Y, the task is to find the minimum number of operations required to make X equal to Y by performing the given operations such that:X = X + 1Y = Y ...
read more
Bit Magic
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Minimize sum of count of unique elements in Array after dividing into [1, N] subsets
Last Updated: 23 July 2025
Given an array arr[] of length N, the task is to find the minimum number of unique elements possible in total when the array is divided into K subsets (for all K in the ra...
read more
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Arrays
subset
partition
Minimize insertions in Array to make ratio of each pair as K
Last Updated: 23 July 2025
Given an array arr[] of length N the task is to find the minimum number of elements to be added in the array such that there exists every independent pair in the array who...
read more
Greedy
Mathematical
Hash
Geeks Premier League
Geeks-Premier-League-2022
DSA
Arrays
Ratio and Proportion
Minimize given Number by swapping adjacent digits with odd difference
Last Updated: 23 July 2025
Given a string S of length N representing an integer that consists of only characters '1', '2' and '3', the task is to find the smallest number that can be formed from the...
read more
Strings
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Arrays
Construct an Array of length N containing exactly K elements divisible by their positions
Last Updated: 23 July 2025
Given two integers N and K, the task is to construct an array of length N containing exactly K elements divisible by their positions.Examples:Input: N = 6, K = 2Output: {5...
read more
Pattern Searching
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Arrays
Represent N as sum of maximum number of unique positive integers
Last Updated: 07 March 2022
Given a number N, the task is to represent N as sum of maximum number of unique positive integers.Examples:Input: N = 12Output: 1+ 2 + 3 + 6Explanation:Possible splits are...
read more
Greedy
Mathematical
Combinatorial
Geeks Premier League
Geeks-Premier-League-2022
DSA
Find groups in given range having at least K consecutive composite integers
Last Updated: 23 July 2025
Given a range [L, R] and an integer K, find all the groups in the given range having at least K consecutive composite integers. Example:Input: L = 500, R = 650, K = 10Outp...
read more
Mathematical
DSA
Sort given Array based on the fractional values
Last Updated: 23 July 2025
Given an array arr[] that contains N real numbers. The task is to sort the array in decreasing order of the Fractional ValuesNote: If the values of the fractional part are...
read more
Sorting
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Generate longest Array containing distinct even integers with sum N
Last Updated: 23 July 2025
Given an integer N. Find the maximum length sequence containing distinct even integers with sum N. In case, such a sequence does not exist, return an empty sequence.Exampl...
read more
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Arrays
Minimum flips to make mean of all k size sub-arrays less than 1
Last Updated: 23 July 2025
Given an array A of size N, having each element either 0 or 1 and an integer K. Find the minimum number of elements that need to be flipped, such that no sub-array of size...
read more
Greedy
Mathematical
Geeks Premier League
Geeks-Premier-League-2022
DSA
Arrays
Binary Tree
subarray
Count of 1's after flipping the bits at multiples from 1 to N
Last Updated: 23 July 2025
Given N sized binary array A[] containing all 0's initially. The task is to find the final count of 1's after flipping the bits at multiples from 1 to N.Examples:Input: A[...
read more
Mathematical
Puzzles
Geeks Premier League
Geeks-Premier-League-2022
DSA
binary-string
Count of cells equal to X in Matrix constructed as sum of rows and columns
Last Updated: 19 September 2022
Given integer N denoting the size of a square matrix whose each element is the sum of its row and column i.e., mat[i][j] = i + j (0 i, j, ≤ N), and an integer X, the task...
read more
Mathematical
Matrix
Geeks Premier League
Geeks-Premier-League-2022
DSA
1
...
20
21
22
...
341