Ad
  • Default User Avatar
  • Custom User Avatar

    It would be really nice way to ban cheaters. Put something useless in your code and everyone who just copies it should be banned.

  • Custom User Avatar

    You should print the inputs to see--> https://docs.codewars.com/training/troubleshooting

  • Custom User Avatar

    These two lines add an index for faster regex matching, look up pg_trgm in the docs for more details. It works with provided dataset but there is a downside for searching like this. For example, if a prospect named Annabelle Smith exists and I need to find Anna Smith then the query will return a false positive.

  • Default User Avatar

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

  • Custom User Avatar

    the problem is that all comments appear in the dashboard of any user. ;)

  • Default User Avatar

    Oops. I did originally mark as spoiler but then it unchecked when I edited.

    I did wonder though, given that this is in the solutions section, wouldn't it only be seen by people who have already solved/given up?

  • Custom User Avatar
  • Default User Avatar

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

  • Default User Avatar

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

  • Custom User Avatar

    Hi,

    Not an issue, a question. Generic message below, for some context:


    Seems you're "rather new" to cw, so here are some general guidelines about the comments:

    • Issue: problem in the kata itself (description, wrong tests, wrong internal solution...)
    • Suggestions: well, I guess that part is clear
    • Question anything else that is related to you having a problem solving a kata -> that's you, currently.

    When you post issues:

    • provide ALL the useful information:
      • language
      • input
      • outputs (actual expected) when relevant
      • error message when relevant
    • 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)

    When you post a question: well, most of the above apply too x)

    When you post code, use proper github markdown, so that it's readable.


    So, seems you're doing java. Your problem is that you trim the spaces "everywhere" while you should do it at some specific places (edit: careful about the rules for new lines)

    I'd urge you to actually print to the console a representation of the actual string, and not just the string itself, so that you see the different kind of space characters. => s.replace(" ",".").replace("\n"," \\n"), for example.

    closing & cheers

  • Default User Avatar

    I'm finding some confusion about trailing spaces. When attempting the tests, if I don't remove trailing spaces I get

    random
    
    expected:<apples, pears[
    grapes
    bananas]> but was:<apples, pears[ 
    grapes
    bananas ]>
    

    If I trim white spaces

    edges
    
    expected:<a
    [ ]b
    c> but was:<a
    []b
    c>
    
  • Default User Avatar

    Very efficient solution!

  • Custom User Avatar

    True, it's not necessary. Not sure why I did that.

  • Default User Avatar

    This is really nice code. Just one question...for the seconds, why is it necessary to do (seconds%3600)%60? Surely seconds%60 would be sufficient?

  • Loading more items...