Ad
  • Custom User Avatar

    When your first solution fails, check the examples for clues as to how the actual problem works. I had to toss this one into a spreadsheet to get a clear idea of how it actually worked. This is no different than every programming project ever.

  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    a = 1, b = 2, c = 1, d = 3
    7 = 2 * 3 + 1 * 1
    7 = b * d + a * c
    

    the (a, b), (c, d) of "on the one hand..." are not necessarily the same as the previous a, b, c, d that are used to form n; they are a permutation of it, e.g. b, a, d, c

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I don't undertand how 7 is being made in the example.

    7==23+11

    2 and 3 are b and d, hence seems like does not fit the description that e and f must result only from sums (or differences) of products between on the one hand (a, b) and on the other (c, d) each of a, b, c, d taken only once.

  • Custom User Avatar
  • Custom User Avatar

    I am unsure whether this is an issue or a question but for some reason my racket code is not doing the math correctly.

    For example, (((1+sqrt(5))/2)^73)/(sqrt(5) equals 806,515,533,049,393 but my code gets the math wrong by one digit. I am so confused because the math is correct and this is the simplest formula I know got fibbonacci numbers. I don't understand why it is getting the math wrong because the formula is not that computationaly intensive.

    Btw, this problem is also the same in Dr. Racket on my computer. But it is a language problem for sure because the math I am using is a 100% correct.

  • Custom User Avatar

    Timing out is not a kata issue.

  • Custom User Avatar

    My code keeps timing out in Racket even though it finishes in dr. racket immediately.

    I believe there is some sort of glitch since for some reason this cannot handle the situation where x equals 0. No matter how I try to include the code always times out. I even directed included a cond statement stating that whenever m is 1, x should be 0. I cannot recreate this issue in Dr. Racket.

  • Custom User Avatar

    the example code is very good and only reason I could solve the question.

  • Custom User Avatar

    old price matters since the oldcar gets sold when the new car is bought. So the value of the oldcar is also important in the context of this question.

  • Custom User Avatar

    I was struggling cuz I named my function tankvol lol. That one hyphen wasted so much time it isnt even funny.

  • Custom User Avatar

    No worries, Racket is quite unusual in that regard.

  • Custom User Avatar

    I am using Racket and getting error- Expected #f, but instead got #f.

  • Loading more items...