You are viewing a single comment's thread. Return to all comments →
I had the same general idea, but it's not passing even though the output is identical :/
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int stairs = scan.nextInt(); for (int i = 0; i < stairs; i++) System.out.printf("%" + (stairs + 1) + "s", new String(new char[i + 1]).replace("\0", "#") + "\r"); } }
edit: crap. changed the CR to newline and it passed.
Seems like cookies are disabled on this browser, please enable them to open this website
Staircase
You are viewing a single comment's thread. Return to all comments →
I had the same general idea, but it's not passing even though the output is identical :/
edit: crap. changed the CR to newline and it passed.