Ad
  • Custom User Avatar

    @sam-jollife, if "et" were placed at the start of the string, it would still appear as "et" rather than "Et" since the entire string is lowercase. So code warriors only have to handle the "et" case.

  • Custom User Avatar

    In the Opera browser, I had to switch to bright mode using the switch at the top right corner of the CW window. In dark mode, the dark text was really hard to read.

  • Custom User Avatar

    I would prefer a project configuration in CW in which Check for arithmetic overflow is activated. I would rather not know how often an undetected integer overflow occurs in the random tests for both the user code and the sensei code and the solution is considered valid.

  • Custom User Avatar

    the solution is displayed as best pratices but DRY (LCM(x, y) is calculated twice)

  • Custom User Avatar

    I assume that I can transfer the characters correctly from the browser to VS, i.e. converting from UTF8 to Unicode. `

    "ẞtß".ToLower() gives hex:"DF-00-74-00-DF-00", therefore "t" is the single non-repeating char.
    
    I make the same steps with "σtς" which gives: hex	"C3-03-74-00-C2-03".
    From this result I would conclude that "σ" is the first non-repeating character. What is my mistake?
    
    VS displays your 3rd string with an obviously different character than the browser.
    
    
    
    
  • Custom User Avatar

    I would like to know why there are so few solutions with Linq (estimated less than 10% of the solutions are done with Linq), although a Linq solution can usually be understood much faster than an interative solution

  • Custom User Avatar

    Thank you very much. I have found a nice Linq solution with SingleOrDefault()

  • Custom User Avatar

    the random tests in C# were producing strings that did not conform to the specification: the matrix could have different characters (besides '*') in the same column. My guess is that nobody noticed it until now because most solvers looped from top row to bottom row and exited as soon as a non-'*' was found.

    I fixed the C# RNG, and I also added nicer assertion messages that display the input. Your code passes the random tests now. It still fails the edge cases test (empty arrays / empty strings), but that should be an easy fix.

  • Custom User Avatar

    (csharp)I can't find out why the result for this input:

    copies=*v*l****, ***l]*W*, +vg*]WWN, +*g****N, *WYhDw*d, 8WYhD*Y*, *WY*Dw*d, 8WYhD*Yd, 8WYh*wYd
    

    should be:

    +vgl]WWN
    

    notice: some strings start with '+' und some strings start with '8' and some with '*'

    Can someone help me please?

  • Custom User Avatar

    (C#) In VS the random tests use \n but the tests defined by verbatim strings (i.e. @"...") use \r\n AFTER copying to VS.The codewars environment uses \n in both cases. Your solution should replace as first operation \r\n by \n:

    snapshot.Replace("\r\n","\n")
    In this case you cannot write: snapshot.Split(Environment.NewLine)
    
  • Custom User Avatar

    Also the "Geometry" tag might be helpful.

  • Custom User Avatar

    They don't necessarily arrive on the minute intervals. Your calculation is approximately correct, but not accurate enough.

  • Custom User Avatar

    To the serial downvoter, I will find out who you are, do worry about it.

  • Custom User Avatar

    Montecarlo is meant to time out. You need a more optimised solution. It doesn't hurt learning about Bayesian Statistics.

  • Custom User Avatar

    I assume I am missing something but I'm confused by the 18.75 value for the example. The boy arrives from 07:55 to 08:01 which is 7 different arrival times (55, 56, 57, 58, 59, 00, 01), the bus arrives between 07:58 and 08:02 giving 5 different arrival times (58, 59, 00, 01, 02). Therefore there are 7*5=35 total scenarios, of which 6 mean he will miss the bus:
    boy arrives at 07:59, bus arrives at 07:58,
    boy arrives at 08:00, bus arrives at 07:58 or 07:59,
    boy arrives at 08:01, bus arrives at 07:58, 07:59, or 08:00
    So 6 misses out of 35 total scenarios is 17.14% ?
    What am I missing?

  • Loading more items...