SarvarKh / microverse-coding-challenges

9 stars 0 forks source link

Drawing book #1

Closed SarvarKh closed 3 years ago

SarvarKh commented 3 years ago

In this coding challenge (Drawing Book)

I have solved the problem in the following steps

  1. Make an array of pages;
  2. Count number of pages from the front to arrive to the page;
  3. Count number of pages from back to arrive to the page;
  4. If countFront > countBack => return countBack. Else return countFront;