+ 1
just need a bit help
here is my attempt https://code.sololearn.com/cxUHm6ilvdFJ/?ref=app I want the exact pattern that has given me to print unfortunately I'm unable to make. so if you can help me in making logic of it so please help. i want this pattern // * // * * // * * * // * * * * // * * * * // * * * * * but I'm getting it horizontally.
4 odpowiedzi
+ 4
Find formula.observe carefully..
you can :
* find max value from array.
* use 2 loops,
outer loop, From row=0 to max :
Repeat inner loop from o to arr.length
If row+array_value>=max print "*"
else space.
or add to 2d matrix then print left rotated matrix
+ 2
Instead of printing "*" to the console, place it into a matrix at an equivalent X/Y position. After loop completes print the matrix, but transposed.
+ 1
Davinder Kumar Instead of printing during the loop, write the characters into a two-dimensional array. Then you can print from the array in a transposed order.
+ 1
Brian what characters are you talking about ?