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.
Are numbers with 3 different sums (e.g. 87539319 = 167³ + 436³ = 228³ + 423³ = 255³ + 414³) considered as a case where you should return
true
?In the description, the
reduce()
method is required to return a lambda object, but the tests expect a string instead.Java: Random tests will always expect
false
, even when the ultra rare chance occurs, that an actuallytrue
case was drawn.This comment is hidden because it contains spoiler information about the solution
This is not checked (at least in python).
Don't we need to know anything about alpha-reduction to pass this kata?
You don't explain how we should "apply" terms.
Are the coefficients always integers?
So I was able to solve this on here, it's pretty simple, but I wanted to go through and try to write it all out in VSCode. How would I do that? I want to put the triangle and the similar outputs in my file_name_spec.rb file to populate the solutions I need. I have everything as individual arrays (e.g. method_name([1]).to e(1), ([3,5].to e(8)) etc.) I'm trying to do it like this because I am new to programming and looking for work and have been asked to use my prefered editor to solve the problems I've been given in interviews and I'm not yet use to having to build out all the files on my own. In the course I took everything was already laid out for me, all I had to do was run bundle an solve the problem. Any help at all with how I could do this in VSCode would be great, thanks!
Ruby 3.0 should be enabled, see this to learn how to do it
The test suite doesn't provide polynoms with large coefficients associated to the highest term, for now. That allowes wrong approaches to pass. Tests should be adde'd for that.
This comment is hidden because it contains spoiler information about the solution
Take a good look at triangle row sum, once you see it you will know what to do...
*Take a break but never give up!*
Ruby code-
Below code (as triangle over multiple lines) in string format works. When running tests and submit in CW's its calls 'NilClass' error for the triangle.
The triangle in the example, this is a String class structure?
$triangle =
'1
3 5
7 9 11
13 15 17 19
21 23 25 27 29'
def row_sum_odd_numbers(n)
if $triangle.class == NilClass
return 1
else
new = []
end
end
In the kata, my code calculates Math.cbrt(1728) === 11.999999999999998 instead of 12. (I'm writing in JS). The web app I use to test it (repl.it) does not have this same error, which makes it kind of hard to debug. I assume that it's some kind of floating point error related to converting between binary and decimal, but that's all I've got. Does anyone have any advice on where I could find some resources on this, or what this kind of issue called so that I can look it up myself.
Beyond that, does anyone smarter than I have a reason why this error is present on CodeWars but not repl.it?
This comment is hidden because it contains spoiler information about the solution