accepted linear solution
add binary search
answer to findMin