Given an array nums of length N which contains two types of numbers, one which has the value zero, the second which is a positive… Read More
Category Archives: Mathematical
Given an integer N which corresponds to a N x N grid. The score you can get from a cell at the ith row and… Read More
Given an integer val. Split the given integer in two integers val1 and val2 such that val1 + val2 = val and the difference between… Read More
Invariants and Monovariants are the two properties of mathematics and computer science that describe objects and algorithms. Invariants and mono variants are important mathematical concepts… Read More
Given a 2D array span[][] of length N which contains spans [L, R] (0 ≤ L ≤ R ≤ 109), the task is to merge… Read More
Given two walls A, B with M, and N hooks respectively. You are also given K ropes. By using one rope you can connect one… Read More
There is a carpet of size A * B [length * breadth]. Given a box of size C * D, the task is to fit… Read More
Given an input matrix mat[][] of size m*m and the task is to convert the given matrix into a difference matrix of the same size… Read More
Given two N-digit integers X and Y, the task is to minimize the product of X and Y by performing the following operation any number… Read More
Given counts of x, y, and z, the task is to find the maximum number of triplets that can be made from the count of… Read More
Given an array A[], the task is to count the number of XOR-friendly pairs. An XOR-friendly pair is defined as a pair of elements for… Read More
Given an array arr[] of length n which contains positive integers (0 ≤ arr[i] ≤ 109), the task is to count the number of elements… Read More
Knuth’s up-arrow notation, also known as Knuth’s arrow notation, is a mathematical notation for exponentiation that was introduced by Donald Knuth in his book “Concrete… Read More
Given an array arr[] consisting of N elements. At each operation, you can select any 2 adjacent elements in which both the elements are of… Read More
Given two numbers A & B, the task is to find the length of the maximum sequence containing multiples of either A or B only… Read More