Cant find error in my submitted code

cant find compilation error in my code

  • Given pattern is seen as first we need to work for spaces and then for the numbers in each row.
  • Numbers are first increasing till the mid element and then decreasing till end of the row.
  • Thus, do the work of first spaces and then for numbers .
  • And then change variables accordingly for next iterations.

Always think of first row and then work for the next iteration and repeat the work total number of row times. That’s how you can solve any problem related to pattern.
see this