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.
Man this is genius! I totally forgot about
.includes()
. I ran a forEach onb
. 😅What would be the optimal solution?
This comment is hidden because it contains spoiler information about the solution
Your self-assurance is admirable. It is also unreasonable.
Yes i agree the kata is flawed for this. I commented this and others replied telling me i was wrong but i am certain the kata is flawed
Either the wording of the problem is flawed, or the testing batteries are. 4 pancakes (at 2 mins each) on a max-3 pan CANNOT take 3 (shouldn't even be possible to be an odd number, according to the description) minutes to produce 4 cooked pancakes. Whether 4, 5, or 6, you'd need to be running that griddle an additional 2 minutes (total 4) to finish the next 1-3 flapjacks.
Then hire more pancakes!
And this is why AI ain't replacing cooks anytime soon. If your cook takes 4 minutes to bake 3 pancakes in a 2-pancake pan, fire them.
"There are 3 pancakes and the pan fits 2 so we need to do batches of pancakes in rounds = 3 pancakes / 2 pancakes/batch = 1.5 rounds
Since we can't cook half a pancake, we round 1.5 rounds up to 2 rounds
It takes one minute per side and we need to cook two sides so that's 1 minute/side * 2 sides = 2 minutes per pancake
If we have 2 rounds of pancakes and each pancake takes 2 minutes to cook then it will take 2 rounds * 2 minutes/round = 4 minutes to cook all the pancakes
So the answer is 4" - Gemini AI (Google AI)
OP tells us bullshit.
Wow this is pretty cool. I didn't know JS checks the ASCII values behind the scenes.
Also, returning the condition itself would work.
Just wasted my time on this. it seems I'm not the only one who has an issue.
After understanding the question, I concluded that this is similar to the pagination algorithm.
1 pancake, 2 pancake limit:
This passed all simple tests. How can 3 be expected? Its not a multiple of 2.
You can't serve half pancakes. Even if you did, it'll still take a minute on each side.
I had the same thinking but couldn't articulate it in code. Very clever and readable!
I like this one. It's easier to read.
I like this solution but I'm confused ... why 9?
This is sweet, understandable and simple!
Loading more items...