Getting segmentation fault

getting segmentation fault, i code according to the question given in the graph challenges

@shivamgoel150
This is the updated code:

There were some errors in your code.

  1. Size of the board array must be equal to (cell + 1) because you are storing the increment or decrement for each number between 1 and cell. Also initialize the array to 1.
  2. The play starts from index 1 and not 0. Please correct that.
  3. Start the bfs from index 1.

Refer to the updated code and correct your code.
If my answer was able to answer your query, please mark the doubt as resolved.