Skip to content

Instantly share code, notes, and snippets.

View UtmostCreator's full-sized avatar
🎯
Focusing

Roman UtmostCreator

🎯
Focusing
View GitHub Profile
@UtmostCreator
UtmostCreator / recursion.php
Last active December 11, 2025 23:03
recursion function and its own stack frame
<?php
function rDemo($n, $level = 1): void {
$indent = str_repeat(" ", $level - 1);
echo $indent . ' => Entering level ' . $level . "(n={$n})" . PHP_EOL;
if ($n <= 0) {
echo $indent . "Base case reached at level " . $level . " (n = " . $n . ")" . PHP_EOL;
return;
}
rDemo($n - 1, $level + 1);
@UtmostCreator
UtmostCreator / cloudSettings
Last active May 29, 2025 07:15
PHP Write a function that outputs a transformed number by adding 1 to each digit. Example: transformed(151) => 262 transformed(982) =>1093 transformed(991) =>10102
{"lastUpload":"2020-05-17T17:42:28.337Z","extensionVersion":"v3.4.3"}