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
Java Program to Rotate digits of a given number by K
Given two integers N and K, the task is to rotate the digits of N by K. If K is a positive integer, left rotate its digits. Otherwise, right rotate its digits.Examples:Inp...
Read More
Java
Mathematical
number-digits
rotation
Java Programs
DSA
10 Skills Java Programmers Can Learn in 2022
As we all know, with the change of technology, the world of digitalization is getting smoother day by day. Talking about Java, the language has drastically evolved in the ...
Read More
Java
GBlog
Replace each Matrix element with its row product except that element
Given a 2D-array mat[][] of order M*N. The task is to replace every element of each row with the product of other elements of the same row.Examples:Input: mat[][] = {{3, 4...
Read More
Matrix
Algo Geek
Algo-Geek 2021
DSA
Complement of Base 10 Integer
Given a base 10 integer N, the task is to find the 1's complement of this Base 10 Integer.Examples:Input: N = 5Output: 2Explanation: Binary representation of 5 is "101". I...
Read More
Bit Magic
Mathematical
DSA
Day-Stout-Warren algorithm to balance given Binary Search Tree
Given an unbalanced Binary Search Tree (BST), the task is to convert it into a balanced BST in linear time and without using auxiliary space.Examples:Input: 5 ...
Read More
Algorithms
Binary Search Tree
Algo Geek
Algo-Geek 2021
DSA
Find longest range from numbers in range [1, N] having positive bitwise AND
Given a number N, the task is to find the longest range of integers [L, R] such that 1 ≤ L ≤ R ≤ N and the bitwise AND of all the numbers in that range is positive.Example...
Read More
Bit Magic
Mathematical
array-range-queries
Bitwise-AND
DSA
Minimum replacements with any positive integer to make the array K-increasing
Given an array arr[] of N positive integers and an integer K, The task is to replace minimum number of elements with any positive integer to make the array K-increasing. A...
Read More
Arrays
Algo Geek
Algo-Geek 2021
DSA
Maximize the value left after reducing the Arrays based on given conditions
Given three arrays arr1[], arr2[] and arr3[] of integers, the task is to find the maximum value left in an array after performing the following operation, where in each op...
Read More
Arrays
Greedy
Mathematical
DSA
Replace diagonal elements in each row of given Matrix by Kth smallest element of that row
Given a matrix mat[ ][ ] of size N*N and an integer K, containing integer values, the task is to replace diagonal elements by the Kth smallest element of row.Examples:Inpu...
Read More
Arrays
Matrix
Algo Geek
Algo-Geek 2021
DSA
Minimize modulo operations to make given Array a permutation of [1, N]
Given an array arr[] of size N, the task is to find the minimum number of operations required to make the array a permutation of numbers in range [1, N] where, in each ope...
Read More
Arrays
Binary Search
Greedy
Sorting
DSA
Right rotate given Array K times using Pointers
Given an array arr[] of size N and an integer K, the task is to right rotate the array K times.Examples:Input: arr[] = {1, 3, 5, 7, 9}, K = 2Output: 7 9 1 3 5Explanation: ...
Read More
Arrays
Misc
rotation
Pointers
DSA
Encode given String by inserting in Matrix column-wise and printing it row-wise
Given a string S and an integer R, the task is to encode the string by first filling each character in column wise manner from top to bottom in a matrix having R rows and ...
Read More
Strings
encoding-decoding
Algo Geek
Algo-Geek 2021
DSA
Check if substring S1 appear after any occurrence of substring S2 in given sentence
Given strings S1, S2 and S, the task is to check if every substring of S which is same as S1 has another substring of S same as S2 before it. It is given that S1 is always...
Read More
Strings
substring
Algo Geek
DSA
Rearrange given Matrix by replacing mat[i][j] with mat[ mat[i][j] ][ mat[j][i] ]
Given a square matrix mat[][] of order N containing integers in range [0, N), the task is to rearrange the matrix elements in the given manner. Replace the element at mat[...
Read More
Matrix
Algo Geek
Algo-Geek 2021
DSA
Expected number of cluster of cars formed on infinite Road
Given an array speed[] of size N denoting the speed of N cars moving on an infinitely long single lane road (i.e. no overtaking is allowed) from left to right. Initially, ...
Read More
Arrays
Misc
Google
Greedy
Mathematical
Combinatorial
DSA
1
...
4759
4760
4761
...
11245