codeeval.com query board commit. added test cases for later optimization