Suppose that a professor gave a test to 4 students – A, B, C, and D – and wants to let them grade each other's tests. Of course, no student should grade his or her own test. How many ways could the professor hand the tests back to the students for grading, such that no student received his or her own test back?
Use this library to know the result !
Based on this formula :
npm i derangement
let derangementOf = require('derangement')
Pretty straightforward :
console.log(derangementOf(5))
44
To contribute, please submit problems in the Issues tab, or give better implementations with a direct Pull request
This project is licensed under the MIT License - see the LICENSE.md file for details