Code (PHP (brief)) pasted on 2024-10-06, 17:39 Raw Source
- <?php
- $result= [];
- $rangeLeft = $rangeRight = $p = "";
- $mp = 10 - ($c -1);
- $li = 1;
- $ri = (10 - $c) + 1;
- for($i=1; $i<=$c; $i++){
- $rangeLeft .= $li;
- $rangeRight .= $ri;
- }
- for($i=9;$i>=$mp;$i--){
- $p.=$i;
- }
- $array=range($rangeLeft, $rangeRight); // Make an array with every number between e.g. 1117 and 7777
- foreach ($array as $k => $v) {
- // If number does not contain 8,9 or 0 and sum of all 4 numbers is 10
- // Apply function to multiply each number by 10 and add to result array
- }
- }