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.
Edit: what trashy_incel said.
You should not define your own
enum
, it is already written in the preloaded section (which is invisible to you). Remove your own, and your code will compile.I get the following Error:
src/test/java/UmbrellaTest.java:10: error: method minUmbrellas in class Umbrella cannot be applied to given types;
assertEquals(0, Umbrella.minUmbrellas(Weather.CLOUDY), "wrong answer for no rain");
^
required: Umbrella.Weather[]
found: Weather
reason: varargs mismatch; Weather cannot be converted to Umbrella.Weather
src/test/java/UmbrellaTest.java:12: error: method minUmbrellas in class Umbrella cannot be applied to given types;
Umbrella.minUmbrellas(Weather.RAINY, Weather.RAINY, Weather.RAINY, Weather.RAINY),
^
please give me a hint
greets
No it was really hard and not so easy as 6 kyu tasks.
Quite hard idea to solve for me in short time.
"Likewise, IF it is raining in the afternoon AND HE HAS an umbrella at work, he takes an umbrella for the journey home."
assertEquals(2,
Umbrella.minUmbrellas(Weather.OVERCAST, Weather.RAINY, Weather.CLEAR, Weather.THUNDERSTORMS),
"wrong answer for 2 dry mornings and 2 rainy afternoons."
);
In my opinion the instruction is unclear or misleading. Why there is
if( itIsRainingInTheAfternoon && heHasUmbrellaAtWork ) {
heTakesUmbrellaForTheJourneyHome;
}
But what about if it's Raining and he has NOT umbrella at work? In my opinion he should get wet.
And please don't respond with something like "you are the only one who has a problem with it." Of course, I can code to simply pass all tests, but I believe we should code to solve problems, not just pass tests. Even if this is an abstract problem, it is possible to have an umbrella stored at home, but I can't imagine that this man also has an umbrella stored at work.
Or other way, instrucion should be like: if it is raining in the afternoon, he takes an umbrella for the journey home, used or new one.
fun following the umbrellas
Approved
Approved
Good kata, at first i get tricked with the "multiprocess" / "multithread" thing but after a while an idea just struck into my head and help me finish this kata.
CoffeeScript translation
TypeScript translation
JavaScript fix (move to Node 18.x with Mocha + chai)
This might help
This comment has been deleted.
Loading more items...