Ad
  • Custom User Avatar

    Math.floor is unnecessary because (int) will truncate the fractional part of the double.

    I wound up using this method because both my recursive solution blew up the stack and my iterative solution took too long.