Created
April 20, 2020 03:53
-
-
Save ThienTranDuy/28f7267bc6c2af37bcdaf0ddce0a8ce8 to your computer and use it in GitHub Desktop.
Hackerrank challenge - staircase - https://www.hackerrank.com/challenges/staircase/problem
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
function staircase($n) { | |
for ($i = 0; $i < $n; $i++) { | |
echo str_repeat(" ", ($n - $i -1)). str_repeat("#", ($i + 1)) . "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment