Hi @Jarch24. Unfortunately there are many problems with your translation.
The solution setup will not compile because the method is not encapsulated by a class.
.NET naming conventions are not followed (classes and methods use PascalCase).
.NET bracket conventions are not followed (you should be using Allman style for C#, not K&R)
Assertion arguments are in the correct order. For Assert.AreEqual, arguments should be (expected, actual), but you have them passed in as (actual, expected).
Syntax and indentation style is in general inconsistent and poor.
In your testdata generation function you make a new Random which is incorrect since it's seeded by system time. However, it's not an issue because...
There's only one random test, however even then...
you assert that the user solution's result is equal to that of the user solution's result in your random test...
Replace your sample tests with this:
And do what the last 4 test cases are telling you.
If it doesn't work here, it doesn't work at all. Your code is wrong.
Hi @Jarch24. Unfortunately there are many problems with your translation.
PascalCase
).Assert.AreEqual
, arguments should be(expected, actual)
, but you have them passed in as(actual, expected)
.Happened to me too.
Took me a long time but I ended up realizing my code still wasn't efficient enough and fixed it.
Yep, this Kata sucks. I tried 3 different approaches locally and works fine while here I constantly gets timeouts.
@Jarch24, in the meantime, please check your code. There have been 29 completions in C# and no issue reported regarding out of bounds.
I'm not familiar with C#, but I've asked the translator to respond to this.