+ 2

How to make the pattern

abcdcba (no space ) abc cba (1 space ) ab ba (3 space) a a(5space) ab ba (3space) abc cba(1space) abcdcba (no space)

28th Jan 2018, 10:25 AM
Rishabh
2 Respostas
+ 12
2n-1 lines ... (n) + (n-1) /*print n lines first using similiar logic & last (n-1) lines by little modification in logic of 1st n lines other smart ways also exist , but try with above approach first (simplest approach)*/
28th Jan 2018, 10:35 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 9
Can we know what have you tried to tackle the problem? You may start by observing the indices of the missing characters and see if you can filter those values within the loop. 😉
28th Jan 2018, 10:30 AM
Zephyr Koo
Zephyr Koo - avatar