ChapQ4.1

1. O(n^2) algorithm bug fixed
2. add efficient algorithm in O(n)
3. add one more test case
Merge pull request #10 from charnugagoo/master

ChapQ4.1