Print a ladder for given integer N
For given input N, print below pattern.
E.g. N = 5. Output should be >
0
00
000
0000
00000
Timecomplexity for above solution is O(N^2).
Now, how do we solve this in O(N) time complexity?
It requires very simple thinking and can you post O(N) solution in the comment below?
Also add the comment if you cant figure it out.