Solution to Problem 15 on

The problem:

Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner.


How many routes are there through a 2020 grid?

My Solution

#include <stdio.h>

int main(){
  int i,j,x,y;
  long long int mat[21][21]; 

  for (j=0;j<21;j++) 

  for (i=0;i<21;i++)

  for (i=1;i<21;i++)
    for (j=1;j<21;j++)

  for (i=0;i<21;i++){
    for (j=0;j<21;j++)
      printf("%lld ",mat[i][j]); 

  return 0;

Leave a Reply

Your email address will not be published. Required fields are marked *