I think there is a bug in
MaxRet(left.mostRetweeted,MaxRet(left.mostRetweeted,elem))
shouldn't it be?:
MaxRet(left.mostRetweeted,MaxRet(right.mostRetweeted,elem))
and instead of
if (left.isEmpty && right.isEmpty) elem else if (right.isEmpty) MaxRet(left.mostRetweeted,elem) else if (left.isEmpty) MaxRet(right.mostRetweeted,elem) MaxRet(left.mostRetweeted,MaxRet(right.mostRetweeted,elem))
you can also write
MaxRet( if (left.isEmpty) elem else left.mostRetweeted, MaxRet(if (right.isEmpty) elem else right.mostRetweeted, elem) )
I think there is a bug in
shouldn't it be?:
and instead of
you can also write