Ad
  • Custom User Avatar

    This solution just blew my mind, there I was implementing a map, keeping the count of the numbers then checking the remainder etcetc. and I see this lol, chapeau!

  • Custom User Avatar

    This is not a code-golf. This kata was created to practice loops. The max chars requirement rejects solutions with the lyrics copy-paste.

    IMO if this kata were code-golf would not be 7-kyu

  • Custom User Avatar

    This is a code-golf challenge. Proper formatting is not important.
    Counting whitespace forces us to understand where they can be disposed of:
    • you don't need a space between a number and a keyword like "5if")
    • you don't need a space after brackets, quotes...
    • you can put statements directly after the colon (Python)
    • you can probably combine these two statements into one
    ...
    So I think it should be kept like that.

    However, I agree that different languages need different limits. To be at the same level as 300 chars in Python, I suggest:
    • Ruby: 250
    • Javascript: 350
    • Haskell: 400
    Don't know much about the other languages but C# and Go should definitely be much more.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    it should be kyu 8 for golang

  • Custom User Avatar

    for golang it should be kyu 8 not 7

  • Custom User Avatar

    sorry, I wasn't aware thanks for the explanation

  • Default User Avatar

    It's not the author who gives the kyu but a moderator...

  • Custom User Avatar

    @g964 your katas are really great, but I believe the problem is that you take your meassure to set the difficulty. That kata shouldn't be 7 kyu for sure. Challenging topic and easy solution if you have quite good golang knowledge and know packages. I would say for 7 kyu it could be just for low n and that's all, 6 kyu with much longer n. I resolved quite quickly the problem, however I spent few hours to get familiar with appropriate packages. The point is that not all are perseverant, most people could be discouraged and that's not the goal in case of beginners.

  • Default User Avatar

    I am in agreement with astutus (as I posted in my suggestion about three weeks before).

    It could be simple and just not count any white space.

    but you simply can't NOT count any char, which " " is just as much as "H" or "?" must be counted

    The amount of white space found in strings is trivial compared to the amount used in proper formatting in some languages.
    Ideally, white space inside of a string would count towards the 300 char limit, but it would not be a big loss (in C#) if it didn't.

  • Custom User Avatar

    I resolved, but IMHO for golang it is harder then for Python. It is doable, but I have to say that took me the most time from all kyu 7 golang kata
    Let's leave it, if there are more people who share my opinion, then it could be taken into consideration.
    Thanks for replying.

  • Custom User Avatar

    I created this kata for Python and it was ranked as 7kyu. Maybe the translators for other languages should modify the char limit in some cases. But I can't chose that number because I am not fluent in those languages. It is up to them. You should contact them.

  • Custom User Avatar

    the point is that in case of golang, you simply need the proper formating, e.g. you use go fmt on a file or golint.
    Take a look: https://play.golang.org/ and put there
    package main;import "fmt";func main(){for i:=0;i<10;i++{j:=i+10;fmt.Println(j)}}
    wc -c gives 81, then format before running (becase it is required) and wc -c gives 106, ~ +20%
    So it is redundant to remove whitespaces for go, it is not javascript. Maybe the test could count in a more sophisticated way? That's only the suggestion. It is doable but very annoying to prepare the version just for test (removing whitespaces and building one liner)

  • Default User Avatar

    C# is very different than C

  • Loading more items...