Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
function bigSum(string $a, string $b): string {
$a_arr = array_reverse(str_split($a));
$b_arr = array_reverse(str_split($b));
$res = [];
$l = max(count($a_arr), count($b_arr));
echo $l;
for ($c=0; $c<$l; $c++) {
$r = $a_arr[$c] ?? 0 + $b_arr[$c] ?? 0;
if ($r < 10) $res[] = (string)$r;
}
print_r($res);
return '';
}
echo bigSum('1000000000000000000000000000001','465');