Result calculating algo test cases