Update backtracking/magic_sequence.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Jxtopher 2021-07-13 22:56:08 +02:00 committed by GitHub
parent f713beb132
commit 647a3c4a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,8 +5,8 @@
* @details Solve the magic sequence problem with a backtraking
*
* "A magic sequence of length $n$ is a sequence of integers $x_0
* \ldots x_{n-1}$ between $0$ and $n-1$, such that for all $i$
* in $0$ to $n-1$, the number $i$ occurs exactly $x_i$ times in
* \ldots x_{n-1}$ between $0$ and $n-1$, such that for all $i$
* in $0$ to $n-1$, the number $i$ occurs exactly $x_i$ times in
* the sequence. For instance, $6,2,1,0,0,0,1,0,0,0$ is a magic
* sequence since $0$ occurs $6$ times in it, $1$ occurs twice, etc."
* Quote taken from the [CSPLib](https://www.csplib.org/Problems/prob019/) website