Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Backtracking Matrix chessboard-problems

Printing all solutions in N-Queen Problem

The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two queens attack each other. For example, following is a solution for 4 Que...
Mathematical Technical Scripter Modular Arithmetic

Number of solutions to Modular Equations

Given A and B, the task is to find the number of possible values that X can take such that the given modular equation (A mod X) = B holds good. Here, X is also called...
Mathematical Mathematical

Count number of solutions of x^2 = 1 (mod p) in given range

Given two integers n and p, find the number of integral solutions to x2 = 1 (mod p) in the closed interval [1, n]. Examples: Input : n = 10, p = 5 Output : 4 There a...
Dynamic Programming Mathematical Amazon

Number of non-negative integral solutions of a + b + c = n

Given a number n, find number of ways we can add 3 non-negative integers so that their sum is n. Examples : Input : n = 1 Output : 3 There are four ways to get sum 1...
Dynamic Programming Mathematical permutation

Find number of solutions of a linear equation of n variables

Given a linear equation of n variables, find number of non-negative integer solutions of it. For example,let the given equation be “x + 2y = 5”, soluti...

Subscribe to Our Newsletter