19
ArturS
8y

Found this gem today
public findHM(int height, int height2) {
if (height < height2) return height;
return findHM(height - 1, height2);
}

Comments
  • 0
    Hahahahahah
  • 3
    is this supposed to be pointless? It seems like a big recursive function that in the end just returns height2-1 especially since they aren't doubles you don't have to account for possibly having decimals.... Just why?
  • 0
    Min(height,height2-1) ?
  • 2
    @xophe92 yeah that's it although I think in Java it would be Math.min() lol you caught the case I didn't where height starts off smaller than height2
Add Comment