Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Last updated: Aug 7, 2022

Advanced Level

Welcome to the Advance Level of this journey of becoming a competitive programmer! This section deals with more complex problems and data structures and will help you understand these topics in depth, this section contains some of the problems and topics which are often asked in interviews and contains solutions for those problems, but before looking at the problems just focus on attempting the problem yourself.
Segmented Sieve MEDIUM
In this problem, we are going to learn a very important concept in number theory, “Segmented Sieve”. We are also going to analyse the space and time complexity of the approach.
Sieve of Eratosthenes with Linear time complexity
This blog covers the basic concepts of the sieve of Eratosthenes done within linear time complexity.
Integer Factorization
Learn different methods to perform integer factorization of prime and composite numbers.
Primality Tests
In this blog, we will discuss naive tests and the Fermat tests to check whether a given number is prime or not.
Maximize Product of Min Value of Subarray and Sum of Subarray Over All Subarrays of Length K HARD
In this blog, we will see how we can solve the problem of maximizing the product of min value of subarray and sum of subarray over all subarrays of length K’.
Modular Exponentiation
In this article, we'll learn everything about Modular Exponentiation, their operations, and applications and we will learn how they optimize various computer science processes.
Kth Smallest Prime Number in range L to R for Q queries
This blog will discuss how we can solve the problem named ‘Kth smallest Prime Number in range L to R for Q queries’.
Find Prime Numbers in a 2D Array (Matrix) EASY
The following blog discusses the problem 'Find Prime Numbers in a 2D Matrix' along with some approaches to solve it in an efficient manner.
Minimum steps to reduce N to a prime number by subtracting with its highest divisor
This article discusses the approach to finding the minimum steps required to reduce N to a prime number by subtracting with its highest divisor with its implementation in C++.
Author Spider
0 upvotes
Minimize Swaps Required to Make All Prime-indexed Elements as Prime
The task is to make all prime-indexed elements of the array prime with minimum swaps.
Find Any Prime Number P contains given Number N.
In this article, we will discuss the problem of finding the Prime Number P contains given Number N in it.
Make two numbers equal by multiplying with their prime factors the minimum number of times
This blog finds the minimum number of operations needed to make two numbers equal by multiplying with their prime factors
Segregate Prime and Non-Prime Numbers In An Array MEDIUM
The following article discusses an approach to solve the problem of segregating the numbers into two parts Prime and Non-Prime Numbers along with its implementation with helo of few examples.
Program To Find The Nth Composite Number
This article discusses the problem of finding the Nth Composite Number
Find the Shortest Path From One Prime to the Next by Changing One Digit at a Time MEDIUM
In this blog, we will discuss the problem to find the shortest path from one prime to the next by changing one digit at a time.
Number of ways you can always stay either above or below the main diagonal
This blog will cover how to find the number of ways you can always stay either above or below the main diagonal and discuss their Time and Space complexity.
Count all binary strings having length N and contain at least X 0's and Y 1's.
This article will discuss the problem of finding the count of all binary strings having length N that contains at least X 0’s and Y 1’s.
Count of numbers of length N having odd numbers at even indices and prime numbers at odd indices
This article discusses the approach to count the numbers of length N having odd numbers at even indices and prime numbers at odd indices and its implementation in C++.
Author Spider
0 upvotes
Minimum Adjacent Swaps of the Digits Required to Make N Divisible by K MEDIUM
This article discusses the approach to finding the minimum adjacent swaps of the digits required to make N divisible by K with its C++ code.
Author Spider
0 upvotes
Maximum product of integers formed by splitting digits of N into two parts in any permutation
This article discusses the approach to maximize the product of integers formed by splitting the digits of N into two parts in any permutation with its C++ code.
Author Spider
0 upvotes
Count of all the possible combinations of K numbers that sum up to N
This article discusses the different approaches to counting all possible combinations of K numbers that sum up to N.
E. Counting Arrays EASY
In this article, we will solve one of the popular problems, E. counting arrays
Binomial Coefficients MEDIUM
This blog will discuss the topic of binomial coefficients, including the brute force approach and optimal approach.
Nice Permutations
This article will discuss the problem “Nice Permutations”, solution approach to the problem, its C++ implementation, and its time and space complexities.
Author Riya
1 upvote
Number Of Ways To Form A Team Of Size K Having At Least 4 Boys And 1 Girl.
Modulo Fermat's Theorem
This blog will discuss a famous number theory question - Modulo Fermat's Theorem.
Stickman Tree EASY
This article discusses the problem of "Stickman Tree".
Ninja and Chains
This blog will discuss how we can solve a problem - Ninja and Chains.
Modular exponentiation with GCD
This article discusses the solution to the problem “Modular exponentiation with GCD”.
Hidden squares
In this article, we will solve a number theory problem, the concealed square.
Single Number III
In this blog, we will find the two elements that appear only once in an array where two elements appear only once, and all the other elements appear exactly twice.
Remainders Game
This article will discuss the solution for the problem statement “ Game of Remainders”. Along with the solution, the article focuses on the time and space complexity of the solution.
Aman and Multiplicative Queries for two arrays
This article will discuss the solution for the problem statement “Multiplicative Queries for two arrays”. Along with the solution, the article focuses on the time and space complexity of the solution.
Modular Arithmetic
This article discusses and explains fundamental modular arithmetic operations.
Binary Exponentiation
This article discusses the binary exponentiation method.
Extended Euclidean Algorithm
In this article, we briefly discuss working and proof of Extended Euclidean Algorithm.
Introduction to Chinese Remainder Theorem
In this article, we will learn about the Chinese Remainder Theorem discovered by a Chinese mathematician Sun Zi. It is an important theorem, so read until the end to understand better.
Euler’s Totient Function
This blog will cover the theory and implementation part of Euler’s Totient function and discussion over its Time and Space complexity.
Modular Multiplicative Inverse EASY
In this article, we discuss the implementation of brute force and optimized approaches in detail to calculate the modular multiplicative inverse.
Number Of Ways To Get A Sum Equal To N Using Odd Consecutive Natural Numbers
In this article, we will discuss finding the number of ways to get a sum equal to N by adding consecutive odd natural numbers. We will also focus on the complexity of our solution.
Combinatorics (BASICS)
In this article, we will learn about the basic principles of combinatorics.
Pascal Triangle
This article will cover Pascal's triangle & combinatorics topic with a detailed explanation.
nCr - Binomial Coefficient
In this article, we will learn what binomial coefficients are and then will solve various problems using them. We will also look at different ways to compute Binomial Coefficients.
Compute nCr % x
This article will discuss the solution to 'Compute nCr % x'.The article will discuss the different approaches along with the time and space complexity of both solutions.
Lucas Theorem
This article will discuss “Lucas Theorem”.
Author Riya
1 upvote
Fermat's Theorem
In this article, we briefly discuss Fermat's Little Theorem, its proof and code for finding the modular multiplicative inverse.
Strictly Increasing Elements Between a Range
The task is to find the number of ways to select strictly increasing elements between a given range.
N-Dimensional Plane
In this blog, we will learn to solve a problem based on the N-Dimensional plane.
Bee Mesh
This blog will discuss how we can solve one of the most asked problems in backtracking, i.e., Bee Mesh.
Attractive triplets
This article discusses the solution to the problem of attractive triplets.
Find the Array which when sorted forms an AP and has Least Maximum
This article will discuss the problem "Find the array which when sorted forms an AP and has least maximum," the solution approach to this problem, its C++ implementation, and its time and space complexity.
Author Riya
1 upvote
Count of Arrangements of RGB balls with No Duplicates in a Set MEDIUM
In this blog, we will calculate the minimum required sets to place all the red, green and blue balls.
Minimum Operations Necessary to Reduce N to 0 by Substituting N with N/M or Increasing M by 1
Minimum number of operations required to reduce N to 0 by substituting either N with N/M or increasing M by 1.
Smallest divisor of N closest to X
This article discusses the different approaches to find the Smallest divisor of N closest to X with a complete explanation in C++.
Author Spider
0 upvotes
Check if a Number can be Expressed as Product of a Prime and a Composite Number
In this blog we will discuss a coding challenge based on factorization techniques. We will see how to implement Sieve of Eratosthenes to identify prime numbers upto a given limit.
Count of numbers from the range [L, R] whose sum of digits is Y
In this blog, we will discuss a range query problem named count of numbers from the range [L, R] whose sum of digits is Y.
Count of all Possible N Length Balanced Binary Strings MEDIUM
In this blog, we will solve and discuss the Count of all Possible N Length Balanced Binary Strings in both DP, and Binomial Coefficient approaches.
Count Prime in Ranges
This blog discusses a famous interview problem, count prime in ranges. Given a range L and R, we need to find the number of primes between L and R inclusive.
Author Jay
1 upvote
Minimize the count of integers to be added in Array to make each adjacent pair co-prime
This article will brief you on the problem to minimize the count of integers to be added in an array to make each adjacent pair co-prime.
Find the longest subarray with Prime sum in given Array
This article explains the problem to find the longest subarray with a prime sum in a given array.
Count array elements whose count of divisors is a prime number
This article will brief you on the problem to Count array elements whose count of divisors is a prime number.
Prime Numbers from 1 to N that can be Represented as a Sum of Two Prime Numbers
Prime numbers have only two factors, 1 and themselves. In this article, we will write an algorithm to count prime numbers from 1 to N that can be written as a sum of two prime numbers.
Find Kth Number, Which can be Written as the Sum of Powers of ‘N’
In this blog, we will learn to solve a problem based on bit manipulation.
Distinct Passwords
The blog aims to teach to calculate the total number of distinct passwords.
Counting Triangles in a Rectangular space using BIT
In this article, we will discuss the approach to count the number of triangles that can be formed by connecting the points inside a rectangle for multiple queries. We will also focus on the complexity of our approach.
Karatsuba Algorithm for fast multiplication of large decimal numbers represented as strings
This article discusses the Karatsuba algorithm, its intuition and C++ code
Find the remainder when a number A raised to N factorial is divided by P
This article will brief you on the problem to find the remainder when a number A raised to N factorial is divided by P.
The Number of Unordered Pairs of Semiprime Numbers with a Prime Sum in the Range 1 to N
In this article, we will design an algorithm for counting the number of unordered pairs of semiprime numbers in the range [1, N], whose sum is a prime number.
Count the permutations of first N positive integers such that the sum of any two consecutive numbers is prime
In this blog, we will discuss the problem: Count the permutations of first N positive integers such that the sum of any two consecutive numbers is prime. We will also discuss the time and space complexity of the approach discussed.
Count the Possible Sets Using Integers from a Range [2, N] Using Given Operations that are in Equivalence Relation
This article will cover the problem Count of Sets Possible using Integers from a Range[2, N] using Given Operations in Equivalence Relation and its implementation.
Count of sorted triplets (a, b, c) whose product is at most equal to N
In this article, we will discuss the problem to count of sorted triplets (a, b, c) whose product is at most equal to N.
Count of Arrays of Size N that can be Formed Starting With K Such that Every Element is Divisible by the Next Element
In this article, we will design an algorithm for counting the number of the N-sized arrays that can be formed starting with K such that every element is divisible by the next element.
Count of Numbers in Range [L, R] having Sum of Digits of its Square Equal to Square of Sum of Digits
In this article, we will learn how to count of numbers in range [L, R] having sum of digits of its square equal to square of sum of digits.
Number of Ways to Draw K Rectangles Completely Inside Each Other
In this article, we will learn to count the number of ways to draw K rectangles in a 2D grid, such that the current drawn rectangle is completely inside the last-drawn rectangle. We will also focus on the time and space complexity of our solution.
Find the number formed by K times, alternatively reducing X and adding Y to 0
This article will brief you on the problem to Find the number formed by K times, alternatively reducing X and adding Y to 0.
Fermat’s Factorization Method
This blog discusses Fermat’s factorization method for breaking a number into its factors. This is a very useful method to find factors of a number.
Chinese remainder theorem EASY
The article covers the Chinese remainder theorem, its working with hands-on examples, and its implementation with a naive and efficient approach.
Euclidean Algorithm
This blog will cover the theory, implementation, and discussion over the Time and Space complexity of the Extended Euclidean Algorithm.
Multiplicative Inverse
In this article, we will learn how to find the modular multiplicative inverse of a number ‘a’ under ‘m’, learn how to implement it, starting from a naive to an efficient approach.
Factorial Modulo
This blog covers the concepts for understanding factorial modulo with ease, its implementation and algorithm.
Binary Exponentiation MEDIUM
Binary Exponentiation efficiently calculates large exponents using binary representation. Learn how to implement Binary Exponentiation using recursion and iterative approach.
Find the Missing Digit in Given Product of Large Positive Integers
In this article, we will solve a number theory problem that can be asked in the interviews.
Count of unordered pair of indices such that the ratio of elements at these indices is same as the ratio of indices
This article will discuss the problem to get the count of unordered pair of indices such that the ratio of elements at these indices is same as the ratio of indices.
Minimize Cash Flow among a given set of friends who have borrowed money from each other
In this blog, we will be solving the problem of minimizing cash flow and the code.
Minimum initial vertices to traverse the whole matrix with given conditions
This article will discuss the solution to find Minimum initial vertices to traverse the whole matrix with given conditions. Along with the solution, the article focuses on the time and space complexity of the solution.
K Centers Problem
In this article, we will solve an NP-hard problem. One of the most important programming problems and a real-world application: The k centers Problem.
Shortest Superstring
This article discusses the Problem of the Shortest Superstring.
Jump Game
This blog will cover two different approaches to the problem Jump Game with an explanation and their C++ code.
Jump Game II
In this blog, we will build logic for the problem of minimum jumps and other problems related to this.
Boats to Save People MEDIUM
In this blog, we will discuss one of the most asked questions, i.e., boats to save passengers, using two different approaches.
Get Equal Substrings Within Budget
This blog will be discussing the problem Get Equal Substrings Within Budget along with its time and space complexity.
Number of wonderful substrings
This blog finds the number of wonderful substrings in a given string.
Minimum count of Inversion Pairs possible by concatenating N binary strings in any order HARD
The following blog discusses how to find the Minimum count of Inversion Pairs by concatenating N binary strings in any arbitrary order along with its implementation.
Minimum Decrements to Make an Array at Most Zero Such That All Array Elements Are Cyclically Decremented After a Number is Reduced to Zero
In this blog, we will learn to solve a problem, minimum decrements to make an array at most zero such that all array elements are cyclically decremented after a number is reduced to zero.
Lexicographically Incrementing or Decrementing Characters to Convert Characters of STRING1 to Characters Present in STRING2
The task is to find the minimum operations to convert the characters of string1 to the character present in string2.
Sum of beauty in the array
This article discusses the different approaches to finding the sum of beauty in the array with examples and its implementation in C++.
Author Spider
0 upvotes
Rearrange Positive and negative numbers in O(n) time and O(1) extra space MEDIUM
In this article, we will discuss a very interesting problem, in which we have to rearrange the positive and negative numbers such that they will occupy alternate positions, and all extra positive or negative elements will be put an end.
Rearrange Positive and Negative Numbers With Constant Extra Space | Part 2 EASY
This blog mainly focuses on the problem, namely, Rearrange Positive and Negative Numbers With Constant Extra Space. We will discuss the Merge Sort Technique to solve this problem with a proper explanation and flow diagram.
Merge Intervals
In this article, we’ll learn how to merge intervals to make them mutually exclusive.
k smallest elements in the same order using O(1) extra space
In this article, we will discuss how to find the ‘k’ smallest elements in the same order, in detail.
Find the Maximum Repeating Number in O(N) Time and O(1) Extra Space
In this blog, we will discuss a tricky coding problem and try to solve it within the given constraints.
Maximum Disjoint Intervals
This article will brief you on finding the Maximum Disjoint Intervals.
Reduce array to a single element by repeatedly removing an element from any increasing pair
This article will discuss the solution of the problem “Reduce the array to a single non-zero element by repeatedly removing an element from any increasing pair” along with the time complexity and space complexity of the solution
Divide 1 to n into two groups with a minimum sum difference
In this article, we will solve one of the most asked coding problems: divide 1 to n into two groups with a minimum sum difference.
Minimum Number of Arrows to Burst Balloons
This article explains how to solve the problem of finding the Minimum Number of Arrows to Burst Balloons.
Find Minimum Number of Arrows Needed to Burst all Balloons
This article will discuss the problem "Find the minimum number of arrows needed to burst all balloons," the solution approach to this problem, its C++ implementation, and its time and space complexity.
Author Riya
2 upvotes
Equilibrium Point MEDIUM
The equilibrium index of an array is the index at which the sum of the components at lower and higher indices is equal.
Product of array except self
This article will brief you on the problem “product of array except self”.
Implementing Sets Without C++ STL Containers
In this blog, we will learn about the implementation of Set without using C++ STL containers.
Count the Total Numbers With No Repeated Digits in a Range MEDIUM
The following article discusses the problem 'Count the total numbers with no repeated digits in a range' along with its implementation in C++ language.
Maximize count of distinct elements in a subsequence of size K in given array
In this blog, we will take up a coding challenge based on constructive algorithms and tricky observation. We will discuss various approaches to solve the problem.
Find numbers in the range [L, R] that are coprime with all given Array elements
This article discusses the approach to finding the numbers in the range [L, R] that are coprime with all given array elements and implementation in C++.
Author Spider
0 upvotes
Count Of Pairs In Given Array Whose GCD Is Not Prime
This article will discuss to count the pairs in the given Array whose GCD is not prime and the approach to solve this problem.
Introduction to Segment Trees
In this article, we will see an introduction to segment trees. A segment tree is an advanced data structure used to solve range-based queries.
Segment Tree
This article introduces segment trees and explains their implementation to answer range sum queries.
Merge Sort Tree For Range Order Statistics
This blog will discuss an exciting problem: Merge Sort tree for range order statistics. It is based on an advanced data structure called merge sort trees(segment tree). We will discuss the space and time complexity of the approach discussed.
Length of Longest Increasing Subsequences (LIS) using Segment Tree
In this article, we will take a coding problem based on the concept of the Longest Increasing Subsequence. We will solve this problem using a segment tree.
Count of Xs in the Array for a given range of indices after array updates for Q queries
This article will discuss the solution for the problem statement ‘Count of Xs in the Array for a given range of indices after array updates for Q queries’.The article will discuss both naive and optimized approaches along with the time and space complexity of both solutions.
Longest Subarray with GCD Greater than 1
In this blog, we will learn to solve a problem based on longest subarray with GCD greater than 1.
Queries to Calculate the Sum of the Array Elements Consisting of an Odd Number of Divisors
In this article, we will design an algorithm to solve all of the queries about calculating the sum of the elements of an array in a given range with an odd number of divisors.
Queries to Calculate Sum of Squares of ASCII Values of Characters of a Substring with updates
In this article, we will solve a problem using the segment tree data structure.
Queries to calculate sum of squares of array elements over range of indices [L, R] with updates
In this article, we will solve an online range query problem using the segment tree data structure with lazy propagation.
Range Update in a Segment Tree without using Lazy Propagation and Point Query
This article will discuss the solution to do Range Update in a Segment Tree without using Lazy Propagation and Point Query along with the solution, the article focuses on the time and space complexity of the solution.
Queries to Count Array Elements from a Given Range having a Single Set Bit
In this article, we will learn how to count array elements from a given range having a single set bit.
Queries to Find The First Array Element Exceeding K with Updates
In this article, we will learn how to to find the first array element exceeding K with updates.
Maximize value of a pair from two given arrays based on given conditions
The blog aims to introduce you to solve a problem having two arrays and some given conditions.
Range minimum query
In this article, we will see how to solve the problem, Range minimum query.
Queries to find the min index in a range [L, R] having at least value ele with updates
This article will discuss the solution of the problem statement “Queries to find the min index in a range [L, R] having at least value ele with updates” along with the solution, the article focuses on the time and space complexity of the solution.
Queries to calculate sum with alternating signs of array elements in a given range
This article will discuss the problem "Queries to calculate sum with alternating signs of array elements in a given range," the solution approach to this problem, its C++ implementation, and its time and space complexity.
Author Riya
1 upvote
Maximize sum of array by reducing array elements to contain no triplets (i, j, k) where a[i] < a[j] and a[i] < a[k] and j <i < k
In this article we will discuss the approach to maximize the sum of array by reducing its elements by 1 such that it contains no triplets (i,j,k) where a[i] < a[j] and a[i] < a[k] and j < i < k along with it’s space and time complexities.
Query to find the length of the longest subarray consisting of only 1s
In this blog, we are going to discuss a really interesting problem: Query to find the length of the longest subarray consisting of only 1s. We are going to discuss two approaches, first the naive one and then the efficient solution. We will analyze the space and time complexity of the approaches discussed.
Maximum length of same indexed subarrays from two given arrays satisfying the given condition
This article will take a coding problem based on Binary Search and Segment Tree. A segment tree is an advanced data structure used to solve range-based queries.
Queries to Count Array Elements Greater Than or Equal to a given Number with Updates
This article will take a coding problem based on Arrays. Array-based questions are very prevalent in interviews/coding rounds.
Maximize the length of longest subarray consisting of same elements by at most X decrements
This article will discuss the solution of the problem statement "Maximize the length of longest subarray consisting of same elements by at most X decrements" along with the solution. The article focuses on the time and space complexity of the solution.
Queries to Evaluate the given Expression in a range [L, R]
This article will discuss the problem "Queries to evaluate the given equation in a range [L, R]," the solution approach to this problem, its C++ implementation, and its time and space complexity.
Author Riya
0 upvotes
Find Value After N Operations to Remove N Characters of String S with Given Constraints
In this article, we will learn how to find value after N operations to remove N characters of string S with given constraints.
Sum of previous numbers that are greater than current number for given array
In this article, we will take a coding problem based on the application of the Fenwick Tree, also known as the Binary Indexed Tree. Fenwick trees are used to calculate prefix sum efficiently and handle updates efficiently.
Finding XOR of the Array Elements in a Given Range with Updates using Fenwick Tree
In this article, we will design an algorithm to solve the queries of finding the XOR of array elements in a given range with updates of array values using the Fenwick Tree.
Queries for the Number of Nodes having Values Less than V in the Subtree of a Node
In this article, we will take a coding problem based on the application of the Fenwick Tree, also known as the Binary Indexed Tree. Fenwick trees are used to calculate prefix sum efficiently and handle updates efficiently.
Find the Number of Pair of Ideal Nodes in a Given Tree
This article will discuss the problem "Find the number of pair of ideal nodes in a given tree", an approach to solve this problem, its C++ implementation, and time and space complexity.
Author Riya
1 upvote
Range Sum Queries and Update with Square Root
This article will cover the approach and implementation of the problem- Range Sum Queries and Update with Square Root.
Number of elements greater than K in the range L to R using Fenwick Tree (Offline queries)
This article will discuss finding the number of elements greater than K from index L to R for offline queries using the Fenwick Tree. We will also focus on the complexity of our solution.
Count of Inversion of size K in a given array
This article will discuss the problem "Count of Inversions of size K in a given array," an approach to solve this problem, its C++ implementation, and time and space complexity.
Author Riya
1 upvote
XOR of Numbers that Appeared Even Number of Times in Given Range
In this article, we will take a coding problem based on the application of the Fenwick Tree, also known as the Binary Indexed Tree. Fenwick trees are used to calculate prefix sum efficiently and handle updates efficiently.
Sum of Interval and Update with Number of Divisors
In this article, we will discuss the approach to find the sum of a segment of an array and update a segment by replacing every number with its number of divisors for multiple queries. We will also focus on the complexity of our approach.
Maximum Sum of Increasing Subsequence using Fenwick Tree
This article will discuss the solution for finding the Maximum Sum of Increasing Subsequence using Fenwick Tree along with the solution; the article focuses on the time and space complexity of the solution.
Queries for Number of Distinct Elements in the Subarray
In this article, we will discuss the approach to finding the number of distinct elements in the subarray for multiple queries. We will also focus on the complexity of our approach.
Number of Elements less than or equal to a given number in a given subarray
This article will discuss the problem "Find the number of elements less than or equal to a given number in a given subarray, its C++ implementation, and time and space complexity.
Author Riya
1 upvote
Count Inversions using Fenwick Tree
The article covers the use of the Fenwick tree to determine the inversion count in an array
Two Dimensional Fenwick Tree
This article will discuss the Two Dimensional Fenwick Tree concept and its application and its space and time complexity.
Binary Indexed Tree or Fenwick Tree
In this article, we will learn Binary Indexed Tree or Fenwick Tree.
Binary Indexed Tree or Fenwick Tree
In this article, we will discuss Binary Index Tree/Fenwick Tree and see its implementation in c++.
Binary Indexed Tree: Range Update and Range Queries
This article describes the methods to do range update and range queries on a binary indexed tree
Range Update and Range Queries in Binary Indexed Tree
This article will discuss "Range update and Range Queries in Binary Indexed Tree," its C++ implementation, and time and space complexity.
Author Riya
1 upvote
Querying the Number of Distinct Colors in a Subtree of a Colored Tree using BIT
This article will solve a problem on trees using the binary index tree/Fenwick tree. Through this article, we will learn an algorithm to flatten the given tree and see an application of the binary index tree.
Minimum Possible Integer After at Most K Adjacent Swaps On Digits
In this blog, we will discuss an interesting interview problem, namely the minimum possible integer after at most K adjacent swaps on digits. It is a Leetcode Hard problem.
The Skyline Problem
This article discusses The Skyline Problem, which is one of the most challenging questions asked in interviews of tech giants.
SQRT Decomposition EASY
In this blog, we will learn about the SQRT Decomposition algorithm along with an example and will also have a look at its time and space complexity of it.
Sqrt Decomposition Method
In this article, we will learn the importance of the sqrt decomposition method and how it will help optimize query problems.
Sqrt (Square Root) Decomposition EASY
This article will discuss the concept of “sqrt decomposition” and the solution of an example problem using “sqrt decomposition”, its C++ code, and its time and space complexity.
Author Riya
1 upvote
Find jth Smallest Value Present on the Simple Path between Two Nodes MEDIUM
Find jth Smallest Value Present on the Simple Path between Two Nodes of an undirected graph.
SEAD Problem (Codechef) EASY
This article discusses the  ‘SEAD’ problem on CodeChef and its approach.
Matchstick Problem
In this article, we will design an algorithm to solve the queries about the time taken in burning all the matchsticks.
Monster Kill
The task is to find out the longest consecutive subsegment satisfying the mentioned conditions.
Find the S-value of the Given Subarrays Using Mo’s Algorithm
This article will solve a range query problem using square root decomposition/Mo's algorithm.
Mex Puzzle
This blog will discuss how we can solve a problem - Mex Puzzle.
Ninja’s Messenger
This article will discuss the problem “Ninja’s Messenger,” solution approach to the problem, its C++ implementation, and its time and space complexities.
Author Riya
1 upvote
Frequency Range Count
In this blog, we will learn to solve a problem based on the Range theory.
Coprime Queries on Trees
For a given tree with N nodes, the task is to solve the given queries.
Count on a Tree - 2
In this article, we will learn the way to find the number of distinct node values in a path between two nodes.
Sum of All Elements With Odd Frequency in the Given Subarray
In this blog, we will learn to solve a problem based on a range query, the sum of all elements with odd frequency in the given subarray.
Mo's Algorithm
This blog will discuss a famous competitive programming algorithm - Mo’s Algorithm.
Mo's Algorithm With Updates (SUM query)
This blog will discuss a variation famous competitive programming algorithm - Mo’s Algorithm with Updates.
DQUERY - SPOJ
The article describes how to find the number of distinct elements in the given range.
Mo’s On Trees and SQRT Decomposition
In this article, you will learn about Mo’s algorithm and SQRT Decomposition for trees
Priority Queue of Pairs In C++ with Ordering MEDIUM
This blog covers the approach for priority queue of pairs in C++ with ordering, In this we will see the implementation for both order by first element of pair as well as order by second element of pair.
Kth Smallest Element in a Row-Wise and Column-Wise sorted 2D Array MEDIUM
In this blog post, we will learn various algorithms to find the Kth smallest element in a row-wise and column-wise sorted 2D array and its implementation in C++.
Connect N ropes with minimum cost HARD
This article will brief you on the problem connect N ropes with minimum cost.
Sum and Product of K Smallest and Largest Fibonacci Numbers in the Array HARD
This article discusses how to find the sum and product of K smallest and largest Fibonacci numbers in the array.
The Maximum Sum of Two Non-Overlapping Intervals in a List of Intervals | Interval Scheduling Problem
This article will discuss the maximum sum of two non-overlapping intervals in a list of Intervals | Interval Scheduling Problems.
Find The Minimum Range Size That Contains The Given Element for Q Queries
In this article, we will see the approaches to find the minimum range size that contains the given element for Q queries.
Lexicographically Largest String using at most K Swaps at Same Parity Indices MEDIUM
This article will teach how to find the lexicographically largest string using at most K swaps at the same parity indices while discussing the time complexity of the program and its implementation in C++, Java, and Python.
Create Arithmetic Progressions in the Array EASY
In this blog, we will discuss a problem with arithmetic progressions in the array and its efficient solution.
Creative Sorting problem MEDIUM
In this blog, we will discuss a problem based on arrays and sorting, which is the creative sorting problem.
Find the Minimum Length Unsorted Subarray, Sorting Which Makes the Complete Array Sorted
This article will cover the implementation of the problem Find the Minimum Length Unsorted Subarray, Sorting Which Makes the Complete Array Sorted to find the minimum length unsorted array, which makes the array wholly sorted.
Maximum Gap
Our task in this problem would be to find and return the maximum Difference between any two consecutive elements in a sorted array.
Median Again
This blog will cover the approach and implementation of the famous sorting problem, i.e., the Median Again.
Maximum Score Difference
Arrays and Sorting are widely asked topics in coding interviews. This article will look at a problem involving arrays, sorting, and binary search.
Smallest subarray to sort in the given array
This article explains the various approaches to the problem of finding the smallest subarray to sort in a given array.
Maximum Divisors in a Range
This article will discuss the problem of finding the maximum divisors in a range.
Maximum Sum Path
This article will discuss the problem of finding the maximum sum path from two arrays.
Minimum Loss
In this article, we will discuss the problem of finding the minimum loss under the given conditions.
Find the Minimum Difference Between any Two Elements
In this article, we will learn to find the minimum difference between any two elements from a given array.
Find all indices of a given element in the sorted form of the given array
This article covers finding all indices of a given element in the sorted form of the given array.
Sort given Array using at most N cyclic shift on any subarray
In this article, we will learn how to sort a given Array using at most N cyclic shift on any subarray.
Kth lexicographically smallest distinct String from given Array of Strings
This article will discuss the problem “Kth lexicographically smallest distinct string from a given array of strings”, the solution approach to this problem, its C++ implementation, and its time and space complexity.
Author Riya
1 upvote
How to sort and separate even and odd numbers in an array using a custom comparator?
This article covers how to sort and separate the even and odd numbers in an array using a custom comparator with complete explanation and C++ code.
Author Spider
0 upvotes
Minimize the number of Knapsacks with total weight W required to store Array containing elements greater than W/3
This article will discuss the solution of the problem “Minimize the number of Knapsacks with total weigh W required to store Array containing elements greater than W/3” along with the time complexity and space complexity of the solution
Sorting by combining Insertion Sort and Merge Sort algorithms
In this article, we will discuss a sorting algorithm that is made by combining insertion sort and merge sort.
Non-Overlapping Intervals
This article will brief you on finding the number of overlapping intervals to be removed to maximize the Non-Overlapping Intervals.
Chocolate Distribution Problem EASY
The Chocolate Distribution Problem is a problem where you have a certain number of chocolate packets and must distribute them among a given number of children.
Magnetic Force Between Two Balls
In this article, we will learn how to solve the problem, magnetic-force-between-two-balls