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.
C++ Translation.
The C++ setup leaves much to be desired. Only one of
int
andunsigned int
should be used, not both. The more appropriate pattern to use here is a namespace or a class with static methods, rather than a once-instantiated class in PascalCase (which variables should not be named in).Avoid global variables. They add state between function calls that you may have not anticipated. Your function works on your machine likely because you are only testing one call per program; in that respect, your function is correct. However, this global state interferes with all other calls beyond that first one. Restructure your code to not use global variables (recommended) or make sure you reset all global state on each call.
C# Translation
Kata is not well-defined for
decimal
values in the exclusive range (-0.005m
,0m
), such as0.001m.ToCurrency("$")
. Half the answers retain the negative sign and the others do not.This comment is hidden because it contains spoiler information about the solution
I know what evenOrOdd() is but I spent half an hour searching for something similar to evenOrOdd[] and couldn't find anything haha
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Random tests are exactly 40
[]
tests, followed by exactly 40()
tests. This seems pretty exploitable to me since the user might be able to pick up the pattern from the test logs. The simplest/quickest fix I can think of is editing thegenerateTestCases
to generate_.random(10, 13)
test cases for each scenario rather than the hardcoded 10. This way, there is no guarantee about the number of test cases for each scenario, making it harder to exploit.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
same lol
This comment is hidden because it contains spoiler information about the solution
Approved.
Loading more items...