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.
Two pieces on the same square is not a valid configuration in chess, how could the conclusion be that a piece is threatening another?
String include the Comparable moudle which give you
the ability to compare strings using the regular
relation operators (>, <, >=, <=)
https://ruby-doc.org/core-2.7.2/Comparable.html
I would suggest the author link to something like this in the description:
https://en.wikipedia.org/wiki/Bitwise_operation#OR
Let's live it for now, although in general I would prefer to have users figure it out; I would assume @joehenriod was not too familiar with bitwise operators, the rest seems pretty plain to me - but let me know if there are parts to fix in terms of grammar or ambiguity.
You have to create a new array where each element is the result of applying binary
OR
between the elements at the same index of 2 arrays, if one of them is shorter than the other, you have to fill the blanks with an optional parameter.Hope it helps. If some mod consider it as a spoiler, mark it.
This comment is hidden because it contains spoiler information about the solution
i see what you mean, thanks for the pointer.
This mutates the input. And even worse, it mutates the object being iterated in the middle of the iteration.
Far from best practice.
thank you! I tried to stay away from ruby's convenience functions for this solution.
Ruby will consider "0" < "5" (same with "1", "2", "3", and "4")
You have to check if the argument is valid or not.
Only positive reals are valid.
nil
is an invalid argument.A quick search will give you several ways to check whether a variable is nil in ruby.