<?php
$digits = range(10, 100, 10);
function find_100
($digits, $current = array()){ static $matches = [];
foreach ($digits as $key => $digit) {
break;
$match = $current;
$match[] = $digit;
$matches[] = $match;
}
if (count($digits) > 1) { $next_current = $current;
$next_current[] = $digit;
$next_step_digits = $digits;
unset($next_step_digits[$key]);
}
}
}
}
PD9waHAKJGRpZ2l0cyA9IHJhbmdlKDEwLCAxMDAsIDEwKTsKCmZ1bmN0aW9uIGZpbmRfMTAwKCRkaWdpdHMsICRjdXJyZW50ID0gYXJyYXkoKSl7CiAgICBzdGF0aWMgJG1hdGNoZXMgPSBbXTsKCiAgICBmb3JlYWNoICgkZGlnaXRzIGFzICRrZXkgPT4gJGRpZ2l0KSB7CgogICAgICAgIGlmKGFycmF5X3N1bSgkY3VycmVudCk+MTAwKQogICAgICAgICAgICBicmVhazsKCiAgICAgICAgaWYgKGFycmF5X3N1bSgkY3VycmVudCkgKyAkZGlnaXQgPT0gMTAwKSB7CiAgICAgICAgICAgICRtYXRjaCA9ICRjdXJyZW50OwogICAgICAgICAgICAkbWF0Y2hbXSA9ICRkaWdpdDsKICAgICAgICAgICAgc29ydCgkbWF0Y2gpOwogICAgICAgICAgICAkbWF0Y2hlc1tdID0gJG1hdGNoOwogICAgICAgIH0KCiAgICAgICAgaWYgKGNvdW50KCRkaWdpdHMpID4gMSkgewogICAgICAgICAgICAkbmV4dF9jdXJyZW50ID0gJGN1cnJlbnQ7CiAgICAgICAgICAgICRuZXh0X2N1cnJlbnRbXSA9ICRkaWdpdDsKCiAgICAgICAgICAgICRuZXh0X3N0ZXBfZGlnaXRzID0gJGRpZ2l0czsKICAgICAgICAgICAgdW5zZXQoJG5leHRfc3RlcF9kaWdpdHNbJGtleV0pOwoKICAgICAgICAgICAgZmluZF8xMDAoYXJyYXlfdmFsdWVzKCRuZXh0X3N0ZXBfZGlnaXRzKSwgJG5leHRfY3VycmVudCk7CiAgICAgICAgfQogICAgfQoKICAgIGlmKGVtcHR5KCRjdXJyZW50KSl7CiAgICAg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