Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
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.
the solution is displayed as best pratices but DRY (LCM(x, y) is calculated twice)
I assume that I can transfer the characters correctly from the browser to VS, i.e. converting from UTF8 to Unicode. `
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
Thank you very much. I have found a nice Linq solution with SingleOrDefault()
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.
(csharp)I can't find out why the result for this input:
should be:
notice: some strings start with '+' und some strings start with '8' and some with '*'
Can someone help me please?
(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:
Also the "Geometry" tag might be helpful.
They don't necessarily arrive on the minute intervals. Your calculation is approximately correct, but not accurate enough.
To the serial downvoter, I will find out who you are, do worry about it.
Montecarlo is meant to time out. You need a more optimised solution. It doesn't hurt learning about Bayesian Statistics.
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?
This comment is hidden because it contains spoiler information about the solution
Loading more items...