Ad
  • Custom User Avatar
  • Custom User Avatar

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

  • Default User Avatar

    It seems it is a question rather than an issue.
    Did you read carefully this part of the description:
    *More*: 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).

    If you read the numerous comments below you could have seen that somebody answers at a question similar to yours:
    "[5600,19200] doesn't fit the bill if a=b=c=d=100."

    I know that the description is not completely clear but it cannot be so unless I give the solution.
    Sorry for that!
    Note: this result appears in all translations, not only in Go.

  • Custom User Avatar

    [golang]

    according to the description

    why the test caseProd2Sum(100, 100, 100, 100) failed to return [(0,20000),(5600,19200)]

    and return only (0,20000)

    you can find that (5600*5600)+(19200*19200) = ((100*100) + (100*100)) * (100*100) + (100*100))

  • Default User Avatar
    • typo (one more!-) corrected
    • I don't see any problem with that but changed to Quote/white-space/Quantity/white-space/Price/white-space/Status
    • I am waiting for a suggestion from you

    PS: how can it be possible that your solution is exactly the same as mine?

  • Custom User Avatar

    [Golang]

    point1

    • first line package kat should be package kata

    point 2

    • there is clear instruction in the description Quote/space/Quantity/space/Price/space/Status
    • there is some test cases generated from "MY SPACE"

    so please try to remove this test case, or try to change the description.

    point 3

    • some how there is issue about using "math.Round" go pkg, the result is different from using "%.0f"
  • Default User Avatar

    Typo corrected.Thanks.

  • Custom User Avatar

    Golang: the test cases use method Gcd which is not required to implement !

  • Default User Avatar

    Getting the following error:

    Passed: 44 Failed: 1 Errors: 1 Exit Code: 1

    TypeError: Cannot read property 'forEach' of null
    at comp
    at /home/codewarrior/index.js:42:19
    at /runner/frameworks/javascript/cw-2.js:152:11
    at Promise._execute
    at Promise._resolveFromExecutor
    at new Promise
    at Object.describe
    at /home/codewarrior/index.js:27:10
    at /home/codewarrior/index.js:85:5
    at Object.handleError

    My code does not have 42 lines, besides it works on my IDE. What could the issue be?

  • Default User Avatar

    I did submit my solution successfully and didn't find it in solutions list -> CW problem, should appear later

    in Golang the base code: there is issue with the func name it should be "Comp": typo fixed, thanks

  • Custom User Avatar
    • I did submit my solution successfully and didn't find it in solutions list

    • in Golang the base code: there is issue with the func name it should be "Comp"

  • Custom User Avatar

    thanks @g964 for your reply,
    I reviewed my code again and it was my fault.

  • Default User Avatar

    For which values of n do you got that? If you get -9.223372036854775e+12 for a given n, your code is clearly false...
    I tried a few solutions (including Best Pratices ones) and saw no problem. You can see at the top of the page that 46 (out of a total of 1973) guys passed the Go kata. If there had been problems don't you think that somebody would have already seen them?
    ...............
    Since you seem new to CW here are some general guidelines about posts:

    Issue: problem in the kata itself (description, wrong tests, wrong internal solution...)

    Suggestions: well, that part is clear

    Question anything else that is related to you having a problem solving a kata

    For information, when you post issues:

    provide ALL the useful information:

    • language
    • input
    • outputs (actual expected)
    • error message

    check, DOUBLE check that this IS an issue, meaning that the problem is in the kata itself and not in your code. If it's in your code, post rather a question
    If you pass this step, you still have to prove/explain what the issue is (and if you can provide fixes, it's even better)

  • Custom User Avatar

    I'm using GO 1.11

    I found an issues in my solution when i run locally

            main_test.go:42: expected 1.005025; got -9.223372036854775e+12 
            main_test.go:42: expected 1.001915; got -9.223372036854775e+12 
            main_test.go:42: expected 1.00099; got -9.223372036854775e+12 
            main_test.go:42: expected 1.000098; got -9.223372036854775e+12
    

    even after got the Best Practices solution the same issues still exist.