Started at 23:47 2020.11.05 Thursday Nov.
Finished at 22:39 2020.11.06 Friday Nov. (22hrs 52minutes)
Last active
November 6, 2020 15:42
-
-
Save lbvf50mobile/d9d7264b04498afb18b2f8ea679347eb to your computer and use it in GitHub Desktop.
Just PHP FUN 145.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# https://www.codewars.com/kata/576757b1df89ecf5bd00073b Build Tower. | |
function tower_builder(int $n): array { | |
$size = 1 + ($n - 1) * 2; $answer = []; | |
for($i = 1; $i <= $n; $i += 1) | |
array_push($answer,str_pad(str_pad("",1 + ($i-1)*2,"*"),$size," ",STR_PAD_BOTH)); | |
return $answer; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment