derangement
v1.0.1
Published
Solve the problem of counting derangements, written as !n
Downloads
3
Readme
To know !
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 :
Getting Started
npm i derangement
Importing
let derangementOf = require('derangement')
How to use it ?
Pretty straightforward :
console.log(derangementOf(5))
44
Contributing
To contribute, please submit problems in the Issues tab, or give better implementations with a direct Pull request
License
This project is licensed under the MIT License - see the LICENSE.md file for details