【算法】二进制加法 <?php$a = [1,0,1,1,0];$b = [1,0,0,1,0,1];function test($a, $b) { if (!$a || !$b) { return $a ?: $b; } $c = []; $carry = 0; $len = max(count($a), count($b)); for ($i = 0; $i < $len; $i++) { $tmp = 0; 面试题集 2023-07-03 66 点赞 1 评论 100 浏览