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
Path to reach border cells from a given cell in a 2D Grid without crossing specially marked cells
Given a matrix of dimensions N*M consisting of characters 'M', '#', '.' and only a single instance of 'A'. The task is to print any one path from the cell having value A t...
Read More
Arrays
Graph
Searching
Matrix
BFS
DSA
Flip the String by either swapping given characters or rotating it horizontally for Q queries
Given a string S of length 2N and Q Queries containing three integers T, A, and B each, where queries can be of the following two types:T=1: Swap the Ath and Bth character...
Read More
Strings
Competitive Programming
array-range-queries
DSA
Sine Rule with Derivation, Example and Implementation
Given angles(in degrees) A, C, and the side c, corresponding to the figure below, the task is to find the remaining two sides a and b.Examples:Input: A = 45, C = 35, c = 2...
Read More
Geometric
School Programming
math
Trigonometry & Height and Distances
DSA
Make N pairs from Array as (X, Y) coordinate point that are enclosed inside a minimum area rectangle
Given a number N, and an array A[] of size 2N, the task is to make N pairs of these array elements and place them on an X-Y coordinate plane, such that they are enclosed i...
Read More
Arrays
Mathematical
Geometric
Competitive Programming
square-rectangle
DSA
Finite and Infinite Recursion with examples
The process in which a function calls itself directly or indirectly is called Recursion and the corresponding function is called a Recursive function.Using Recursion, cert...
Read More
GATE-CS-C-Language
Recursion
C Language
C++
DSA
Maximum range subarray for each index in Array such that A[i] = min(A[L], A[L+1], … A[R])
Given an array arr[] of N distinct integers, the task is to calculate for each index i (1≤i≤N) a range [L, R] such that arr[i] = min(arr[L], arr[L+1], … arr[R]), where L≤i...
Read More
Arrays
Stack
subarray
DSA
Length of longest subarray for each index in Array where element at that index is largest
Given an array arr[] of size N, the task is to calculate, for i(0=iN), the maximum length of a subarray containing arr[i], where arr[i] is the maximum element.Example:Inpu...
Read More
Arrays
Stack
Algorithms
subarray
C++ Programs
DSA
Find prime factors of Z such that Z is product of all even numbers till N that are product of two distinct prime numbers
Given a number N (N 6), the task is to print the prime factorization of a number Z, where Z is the product of all numbers ≤ N that are even and can be expressed as the pr...
Read More
Algorithms
Mathematical
Competitive Programming
sieve
prime-factor
DSA
Sum of the first M elements of Array formed by infinitely concatenating given array
Given an array arr[] consisting of N integers and a positive integer M, the task is to find the sum of the first M elements of the array formed by the infinite concatenati...
Read More
Arrays
Mathematical
circular-array
DSA
Minimum number of replacement done of substring "01" with "110" to remove it completely
Given a binary string S, the task is to find the minimum number of repetitive replacements of substring "01" to string "110" such that there doesn't exist any substring "0...
Read More
Strings
Mathematical
binary-string
substring
DSA
Find smallest value of K such that bitwise AND of numbers in range [N, N-K] is 0
Given an integer N, the task is to find the smallest number K such that bitwise AND of all the numbers in range [N, N-K] is 0, i.e. N (N - 1) (N - 2) ... (N - K) = 0.Exa...
Read More
Bit Magic
Mathematical
Bitwise-AND
DSA
Minimum number of moves required to sort Array by swapping with X
Given an integer array, arr[] of size N and an integer X. The task is to sort the array in increasing order in a minimum number of moves by swapping any array element grea...
Read More
Arrays
Greedy
Sorting
DSA
C program to draw a solar system using computer graphics
Prerequisite: Graphics.h, include graphics.h in CodeBlocksRequired header files:#include stdio.h#include conio.h#include graphics.h#include dos.h#include math.hFunctions u...
Read More
computer-graphics
C Language
C Programs
c-graphics
Puzzle | The Burning Candles
Problem Statement: Given two candles. Each of them burns for one hour. They burn unevenly in different parts though. In addition, let's have a box of matches. Measure 45 m...
Read More
interview-preparation
Puzzles
Aptitude
Wipro
Logical Puzzles
Python Program to Convert dictionary string values to List of dictionaries
Given a dictionary with values as delimiter separated values, the task is to write a python program to convert each string as different value in list of dictionaries.Input...
Read More
Python
Python Programs
Python dictionary-programs
1
...
5681
5682
5683
...
11195