Yes. I've been working may way through various Kata starting at 8 kyu, then 7, then 6 so far... this one has been much more challenging than any I have done so far.
I don't know much about SQL but I think semicolons are used to separate, not terminate statements.
So if you have several statements, you would use a semicolon between them.
Isn't a semi-colon necessary after a query?
(Just started learning SQL)
This Kata is too dificult for level 7 kyu. The description is also very poor.
I see my flaw. I need to take into account the position of the element in the original array. That way the sequence between say two i in the result becomes the longest.
When I get the following input, the expected is what the tests tell me and the "instead got" is my solution. The expected solution expects the second i before the second a, even the second a appears before the second i in the input.
Input ['i', 'a', 'd', 'h', 'f', 'j', 'a', 'k', 'j', 'c', 'i', 'e', 'd', 'i', 'a', 'b', 'i', 'h', 'e', 'h', 'g', 'g', 'g', 'j', 'i', 'k', 'k', 'k', 'b', 'f']
^ ^ ^ ^
Expected: ['i', 'a', 'd', 'h', 'f', 'j', 'k', 'c', 'e', 'b', 'g', 'i', 'a', 'd', 'h', 'f', 'j', 'k', 'e', 'b', 'g', 'i', 'a', 'h', 'j', 'k', 'g', 'i', 'k', 'i'],
^ ^ ^ ^
instead got: ['i', 'a', 'd', 'h', 'f', 'j', 'k', 'c', 'e', 'b', 'g', 'a', 'j', 'i', 'd', 'h', 'e', 'g', 'k', 'b', 'f', 'i', 'a', 'h', 'g', 'j', 'k', 'i', 'k', 'i']
^ ^ ^ ^
Even the second j should be before the second i.
I keep getting an error
TypeError: Cannot read property '9' of undefined
at transitionFunction (test.js:127:56)
at machine (test.js:10:50)
at Context.<anonymous> (test.js:144:21)
when calling the transitionFunction, which is really annoying. My solution works for the given tests and I cannot see what is wrong with me calling the way I do.
Since the two arguments are both booleans we can use them directly when comparing. This solution asks if I'm employed and (&&) not (!) on vacation. Since this is Ruby, the last executed line in a method is automatically returned.
How in the hell does this work?
This was not a 7 kyu in my opinion.
I knew Ruby could do it in less than 40 characters! Damn!
I'd like to add that not adding the 'return' is more idiomatic Ruby (& also following the Ruby style guide, see https://rubystyle.guide/#no-explicit-return).
yep, but it's optional