i know it but between this two cases i want to understand which one is better. both functions work under 1ms but when we use thousands or milions of times in another programm it would be different.
I guess it's neglectable, the amount of recursions cannot be very high in any case.
I always think that these katas require a lot of time to set up. But I like setting things up compared to thinking ;)
Ruby 3.0 should be enabled, read this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
describe "<This message should describe the categories of test groups inside this block>" do
it "<A short message describing this test group>" do
expect(...).to eq(...) #Assertions
#Or Test.assert_equals(user_response, reference_response)
I dont get why this works
Python Issue on Random TestsTwo To The Power Of One' should equal 'Two To The Power OfOne
Should have Space as was instructed number operator number
Two To The Power Of One' should equal 'Two To The Power OfOne
number operator number
Moreover, Latin does not distinguish between i and j characters (actually j is a late creation in Romances languages)
Well, this could be deduced by just looking at the given examples, and it's not specified that there would be other forms, so one shouldn't assume that to be the case. With that said, a clarification of these requirements is a reasonable request.
Also, please refer to ruby description from @anter69, as it was supposed to be approved right after JS translation, though I don't think it covers your issue.
Please refer to the issue by Johan to see if it needs a bit of description update.
Description doesn't specify expressions will be of the form number operator number, will always have elements separated by a space and possibly more assumptions that the reference solution and the tests use.
[-1, 10, 2, 0] -> [-1, 0, 2, 10] (middle items of SORTED list)
Average of 0 and 2 = 1