Skip to content

Commit 1b0e5ae

Browse files
committed
Drawing Book
1 parent 74067b7 commit 1b0e5ae

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package main
2+
3+
func pageCount(n int32, p int32) int32 {
4+
/*
5+
* Write your code here.
6+
*/
7+
var countFromFront int32 = p/2;
8+
var countFromBack int32 = int32(n/2) - countFromFront;
9+
10+
if (countFromBack < countFromFront) {
11+
return countFromBack;
12+
}
13+
return countFromFront;
14+
}

0 commit comments

Comments
 (0)