Courses
Tutorials
Jobs
Practice
Contests
Data Structure
Java
Python
HTML
Interview Preparation
Trending Now
DSA
Web Tech
Foundational Courses
Data Science
Practice Problem
Python
Machine Learning
JavaScript
System Design
Django
DevOps Tutorial
Java
C
C++
ReactJS
NodeJS
CP Live
Aptitude
Puzzles
Projects
GBlog
Three 90 Challenge: Bigger and Better
As we transit into the new phase, it's essential to fuel our inner drive for success. On popular demand, GeeksforGeeks is happy to announce that we are back with the Thre...
Read More
Minimum number of hint required to get the hidden cell in 2D grid
Given a 2D array of size M * N. The task is to find the minimum number of hint required to pick the correct position of a hidden cell on the grid, where in each hint the M...
Read More
Mathematical
Matrix
Algo Geek
Algo-Geek 2021
DSA
Find One’s Complement of an Integer | Set 2
Given an integer N, find the one’s complement of the integer.Examples:Input: N = 5Output: 2Explanation: Binary representation of 5 is "101". Its one's complement is "010" ...
Read More
Bit Magic
Mathematical
Bitwise-XOR
Algo Geek
Algo-Geek 2021
DSA
Maximum difference of prefix sum for all indices of given two Arrays
Given 2 arrays of integers a[] and s[] both of size N. The task is to find the maximum difference of prefix sum for all indices of the given arrays.Examples:Input: N = 5, ...
Read More
Arrays
Mathematical
prefix-sum
Algo Geek
Algo-Geek 2021
DSA
Count of adjacent pairs in given Array with even sum
Given an array arr[] of N integers, the task is to find the count of pairs of adjacent elements whose sum is even where each element can belong to at most one pair.Example...
Read More
Arrays
Searching
Algo Geek
Algo-Geek 2021
DSA
Abbreviate given string by replacing all characters with length except the first and last
Given string str, the task is to convert the given string into its abbreviation of the form: first character, number of characters between first and last character, and th...
Read More
Strings
Mathematical
C++
C++ Programs
Algo Geek
Algo-Geek 2021
DSA
Print Array after moving first occurrence of given element to end in given Array for Q queries
Given an array arr[] of N integers and an array query[] having Q integers, the task is to print the array arr[] after moving the first occurrence of query[i] to the end of...
Read More
Arrays
Hash
array-range-queries
cpp-unordered_map
cpp-set
Algo Geek
Algo-Geek 2021
DSA
Divide a sorted array in K parts with sum of difference of max and min minimized in each part - Set 2
Given an ascending sorted array arr[] of size N and an integer K, the task is to partition the given array into K non-empty subarrays such that the sum of differences of t...
Read More
Arrays
Binary Search
Divide and Conquer
Searching
Sorting
Algo Geek
Algo-Geek 2021
DSA
Minimum count of words among all the given sentences
Given N lowercase sentences, the task is to find the minimum count of words among all of these sentences.Examples:Input: arr[] = {“there is a cow”,“cow is our mother”,“cow...
Read More
Strings
School Programming
Arrays
frequency-counting
strings
Algo Geek
Algo-Geek 2021
DSA
Longest subarray forming an Arithmetic Progression (AP) with given common difference
Given an array arr[] of N integers and an integer K, the task is to find the length of the longest subarray that forms an Arithmetic Progression having common difference K...
Read More
Arrays
subarray
sliding-window
Arithmetic Progressions
Algo Geek
Algo-Geek 2021
DSA
Minimum removals in range to make bitwise AND non-zero for given range queries
Given an array queries[][] of Q range queries, the task is to find the minimum removals from the range[l, r] such that the bitwise AND of the range is a non-zero value.Exa...
Read More
Arrays
Bit Magic
Divide and Conquer
array-range-queries
Bitwise-AND
Algo Geek
Algo-Geek 2021
DSA
Highest power of a number that divides other number | Set - 2
Given two numbers N and M(M 1), the task is to find the highest power of M that divides N.Examples:Input: N = 12, M = 2Output: 2Explanation: The powers of 2 which divide ...
Read More
Binary Search
Searching
Mathematical
maths-power
Algo Geek
Algo-Geek 2021
DSA
Maximize the difference of sum of elements at even indices and odd indices by shifting an odd sized subarray to end of given Array.
Given an array arr[] of size N, the task is to maximize the difference of the sum of elements at even indices and elements at odd indices by shifting any subarray of odd l...
Read More
Arrays
Mathematical
subarray
prefix-sum
Algo Geek
Algo-Geek 2021
DSA
Find number formed in K steps by reducing N by 1 if last digit is 0 else divide by 10
Given two integers N and K. Perform the following type of operations on N:if the last digit of N is non-zero, decrease the number by one.if the last digit of N is zero, di...
Read More
Algorithms
Greedy
Mathematical
C++
C++ Programs
Algo Geek
Algo-Geek 2021
DSA
Sort given Array in descending order according to highest power of prime factors
Given an array arr[] of size N. The task is to sort the elements in arr[] based to their Highest Degree of Expression, in descending order. The Highest Degree of a number ...
Read More
Arrays
Sorting
Mathematical
sieve
prime-factor
Algo Geek
Algo-Geek 2021
DSA
Length of smallest Subarray with at least one element repeated K times
Given an array arr[] of length N and an integer K. The task is to find the minimum length of subarray such that at least one element of the subarray is repeated exactly K ...
Read More
Arrays
Greedy
Mathematical
subarray
Algo Geek
Algo-Geek 2021
DSA
1
...
4724
4725
4726
...
11195