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.
Actually maybe😂 it depends on what scholarships I'll be able to get when I graduate.
Look, ignore the code police. I understood what you were doing. So clever. Are you at Harvard? 🤣
you are overengineering by calculating inner square. Try math induction, write down equations for 2, 3, 4 with X and look for pattern, then simplify equation
Love this, my code is so bloated in comparison, but I used reduce so not to far from your solution in a way!
I'm having trouble conceptually with the maths here, are there any good resources that can help me understand the inner square growth?
there are six bullet points in the "conditions" section, and from what I read of your message, it looks like you're considering the last two only.
Apologies. I think I misunderstood the description. Please ignore to your hearts content.
This test here
assert.strictEqual(hasSurvived([32, 65, 21, 83, 85, 7, 71, 45, 20, 63], [83, 44, 38, 55, 84, 80, 58, 20, 4, 74]), false);
Isn't it meant to be true?
Same num of soldiers
Attackers points 492 vs Defender points 540
This comment is hidden because it contains spoiler information about the solution
I wrote war and peace to achieve this. Well done for this.
It's the same for all languages in this kata. That's the way the creator defined the task. The rightmost position is 1.
I'm not sure about other languages, but in JavaScript, 0 starts from the left and numbers ascend toward the right. Not sure why 0 starts from the right and ascends to the left.. It's a bit awkward tbh..
This comment is hidden because it contains spoiler information about the solution
Please use markdown tags to format your code, or it is unusable and doesn't display properly (asterisks aren't displayed, etc.), see there: https://docs.codewars.com/training/troubleshooting/#post-discourse
This comment is hidden because it contains spoiler information about the solution