Advertisement
Guest User

Untitled

a guest
Sep 29th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.31 KB | None | 0 0
  1.   def mostRetweeted: Tweet = {
  2.     if (left.isEmpty && right.isEmpty)
  3.       elem
  4.     else if (left.isEmpty)
  5.       maxRetweeted(right.mostRetweeted, elem)
  6.     else if (right.isEmpty)
  7.       maxRetweeted(left.mostRetweeted, elem)
  8.     else maxRetweeted(right.mostRetweeted, maxRetweeted(elem, left.mostRetweeted))
  9.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement