Ad
  • Default User Avatar

    this is because the Node type in preloaded.rs on Codewars does not #[derive(Clone)], unlike the one you wrote on your own machine; see this

    this is not really a kata issue, you don't need to make copies of the nodes, you can manipulate them through references

  • Custom User Avatar

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

  • Default User Avatar
  • Default User Avatar

    In Rust, there is a distinction between to_ascii_lowercase and to_lowercase.
    to_ascii_lowercase is specifically designed for ASCII characters, while to_lowercase is used for Unicode characters.
    to_lowercase function should be used for general case conversion of characters, including non-ASCII characters.
    This is due to the fact that Rust doesn't simplify for you the strings.
    "hello world" has obviously 11 characters, but it is not always 8 bit each, hence, the necessity for different methods based on the type.
    I'm studying rust, and maybe my explanation it is not 100% correct. The free microsoft course for Rust explains very well strings, but the rust doc go deep inside the problem: https://doc.rust-lang.org/std/primitive.char.html

  • Custom User Avatar

    I suppose there is nothing requiring users to come up with an algorithm themselves, but this could be true of any kata, there is nothing requiring users to come up with an implementation themselves either, they could find a solution somewhere and merely transcribe it. But doing so defeats the purpose and works around the kata intent, which I believe also applies here. I do not think this kata was created with the intention for people to merely google, and it to become an exercise in transcription.

  • Custom User Avatar

    Then I think it boils down to the question where is the line of not reinventing the wheel. And I have a feeling that the problem of googling is somehow applicable only to some narrow selection of problems which are easy enough so an average person could solve after sufficient, but potentially large, amount of brain cycles, but not too easy. Because I think no one is expected to spend too much time thinking on problems which are either easier, or harder: "sum of 1 to n" has a commonly known solution and I think no one is expected to come up with the formula on their own, because it's a common knowledge (also the fact that it is anecdotically contributed to one of the brightest minds ever might potentially suggest it's not trivial to get to it on your own). OTOH, I think no one is expected to distil Dijkstra shortest path, Levehnstein distance, Voronoi tesselation, or shunting yard evaluation out of thin air. What is so special about this problem (or category of problems) what would require users to come up with an algorithm by themselves?

  • Custom User Avatar

    I think to me, the difference is whether the kata is targeting the problem solving, or the implementation (or in some cases, both). A kata like "Prime streaming" is clearly not wanting you to rediscover all sorts of established knowledge about prime numbers and algorithms, the kata is about the implementation. On the other side, we have a kata like "Hat Game" where the implementation is trivial, however the entire intent of the kata is to work it out yourself, the kata is about the problem solving. Googling research for implementation kata feels fair enough to me, since the main intent of the kata is still there. However if the kata is a problem solving one, then bypassing that by just googling skips the main intent of the kata, and almost always results in trivial to implement code.

    This kata feels very much like a problem solving kata. The implementation is trivial and the description goes to lengths to not give away certain aspects of the problem such that they can be discovered as a part of problem solving. I also think that it should be pretty obvious to most people when first looking at the kata, that the solution will be some math formula. So googling for it, as expected, comes up with a formula, which are almost always trivial to implement.

    It is of course true that there'll always be people who just google for things regardless, and the rank should account for that. Thats why "problem solving" kata should always attempt to be unique enough that they are difficult to google for. This kata, unfortunately is not at all.

  • Custom User Avatar

    I mean, I guess...? To me there is a difference between "googling an answer" and "googling for research". Using OEIS to me seems like researching for known mathematical facts about a sequence, similar to googling for established prime factoring algorithms, or for papers for purple math kata. But googling "f(f(x)) == 3*x" feels like just googling for an answer, like just the same as googling "Become immortal codewars solution".

    Though, admittedly, I do not really know where the line is or what my logic here is, probably there is none. I am probably just bitter and pretending there is a good reason for it 😅

    I guess you are probably right and we should be taking it into account. This kata would have been much better I think if it were something different, but based on the same idea (if that is even possible?)

  • Custom User Avatar

    This question remains, should we take into account "easy to google problems" when assessing the difficulty level of a kata?

  • Custom User Avatar

    Oops forgot to flag that for a moment

  • Custom User Avatar

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

  • Custom User Avatar

    marked previous comment as spoiler

  • Custom User Avatar

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

  • Custom User Avatar

    I also think 6kyu is too low, however the kata got approved very quickly while there wasnt that many rank assessments, and some of the people who did rank it seem to rank it based on how hard it is to google for a solution, instead of ranking on the difficulty of the task itself.

  • Custom User Avatar

    I wouldn't say that performance is a big deal for this kata... No idea who put this tag there but if you check out other solutions there are quite simpler ways to do it.

    And IMHO it shouldn't matter if you don't know the math part if you can see the pattern, e.g. see this fork: https://www.codewars.com/kumite/642e35826555a3a653795607?sel=642e35996555a39f417958df

    That being said 6kyu is still a bit too low, I'd say it's more like 5kyu?

  • Loading more items...