Pattern_Double-Sided-Arrow

Question : [https://hack.codingblocks.com/contests/c/509/1420]

My code : [https://ide.codingblocks.com/#/s/30121]

in this Question, the lower right part is not correctly coming.

1 Like

https://ide.codingblocks.com/#/s/30137

i hve corrected it for you :slight_smile:

1 Like

in the lower part for spaces after left part, u have used for(int j=n/2+1;j>=2*i;j–){
what is n/2+1 as n is odd???

Say n=5
n/2+1 would be 2+1=3

n=7
n/2+1 would be 3+1=4

Hence it can be both even or odd

https://ide.codingblocks.com/#/s/30753

in this code first test case is wrong answer. why??
(pattern double sided arrow)

This code doesn’t work well when n=5
Try to correct it.