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
Complete DevOps Roadmap - Beginner to Advanced
DevOps is considered a set of practices that combines the abilities of Software Development i.e Dev and IT Operations i.e Ops together, which results in delivering top-not...
Read More
Print the Maximum Subarray Sum
Given an array arr[], the task is to find the elements of a contiguous subarray of numbers that has the largest sum.Examples:Input: arr = [-2, -3, 4, -1, -2, 1, 5, -3]Outp...
Read More
Arrays
Dynamic Programming
subarray
Arrays
Algorithms-Dynamic Programming
Kadane
subarray-sum
DSA
Minimum count of elements required to obtain the given Array by repeated mirror operations
Given an array arr[] consisting of N integers, the task is to find the array K[] of minimum possible length such that after performing multiple mirror operations on K[], t...
Read More
Arrays
Greedy
Divide and Conquer
palindrome
array-rearrange
prefix
DSA
Check if a String contains Anagrams of length K which does not contain the character X
Given a string S, the task is to check if S contains a pair of substrings of length K which are anagrams of each other and doesn't contain the character X in them. If no s...
Read More
Strings
Searching
Hash
Competitive Programming
anagram
Java-HashMap
frequency-counting
substring
DSA
Count of Palindromic Strings possible by swapping of a pair of Characters
Given a palindromic string S, the task is to find the count of palindromic strings possible by swapping a pair of character at a time.Examples:Input: s = "abba"Output: 2Ex...
Read More
Strings
Greedy
Searching
Mathematical
Hash
palindrome
frequency-counting
DSA
Count distinct elements after adding each element of First Array with Second Array
Given two arrays arr1[] and arr2[]. We can generate another array arr3[] by adding each element of the array arr1[] to each element arr2[]. The task is to find the count o...
Read More
Arrays
Greedy
Divide and Conquer
Mathematical
DSA
Count of N digit Numbers whose sum of every K consecutive digits is equal | Set 2
Given two integers N and K, the task is to find the count of all possible N-digit numbers having sum of every K consecutive digits of the number are equal.Examples:Input: ...
Read More
Greedy
Mathematical
number-digits
Numbers
maths-log
maths-power
DSA
Probability of Euler's Totient Function in a range [L, R] to be divisible by M
Given three integers L, R, and M, the task is to find the probability of Euler's Totient Function of a number in the range [L, R] is divisible by M.Euler’s Totient functio...
Read More
Mathematical
sieve
prime-factor
Prime Number
euler-totient
DSA
Minimize count of array elements to be removed to maximize difference between any pair up to K
Given an array arr[] and an integer K, the task is to count the number of elements to be removed from the array such that the difference of the maximum and the minimum num...
Read More
Arrays
Searching
Sorting
Mathematical
DSA
Sum of product of all integers upto N with their count of divisors
Given a positive integer N, the task is to find the sum of the product of all the integers in the range [1, N] withtheir count of divisors.Examples:Input: N = 3Output: 11E...
Read More
Greedy
Mathematical
Competitive Programming
Numbers
C++ Programs
divisors
DSA
Reduce a given Binary Array to a single element by removal of Triplets
Given an binary array arr[] of size N, the task is to reduce the array to a single element by the following two operations:A triplet of consecutive 0's or 1's remains unch...
Read More
Arrays
Pattern Searching
Searching
Mathematical
frequency-counting
DSA
Find two numbers with difference and division both same as N
Given an integer N, the task is to find two numbers a and b such that a / b = N and a - b = N. Print "No" if no such numbers are possible.Examples:Input: N = 6Output:a = 7...
Read More
Greedy
Mathematical
Numbers
DSA
Maximize number of elements from Array with sum at most K
Given an array A[] of N integers and an integer K, the task is to select the maximum number of elements from the array whose sum is at most K.Examples:Input: A[] = {1, 12,...
Read More
Arrays
Misc
Greedy
Mathematical
subsequence
Algorithms-Greedy Algorithms
DSA
Find the first and last M digits from K-th power of N
Given a two integers N and K, the task is to find the first M and last M digits of the number NK .Examples:Input: N = 2345, K = 3, M = 3Output: 128 625Explanation:2345 3 =...
Read More
Mathematical
number-digits
Modular Arithmetic
maths-power
DSA
Count of numbers upto M divisible by given Prime Numbers
Given an array arr[] of Prime Numbers and a number M, the task is to count the number of elements in the range [1, M] that are divisible by any of the given prime numbers....
Read More
Arrays
Dynamic Programming
Mathematical
Competitive Programming
sieve
Prime Number
divisibility
Maths
DSA
Count of all possible pairs having sum of LCM and GCD equal to N
Given an integer N, the task is to find the count of all possible pairs of integers (A, B) such that GCD (A, B) + LCM (A, B) = N.Examples:Input: N = 14Output: 7Explanation...
Read More
Searching
Mathematical
GCD-LCM
DSA
1
...
7140
7141
7142
...
10993