This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns an array containing all sequences of numbers that sum to $num, | |
* e.g. sequencesThatSumToNumber(3) => array(array(1, 1, 1), array(1, 2), array(2, 1), array(3)) | |
* | |
* @param int $num | |
* @return array | |
*/ | |
function sequencesThatSumToNumber($num) { |