This is too hard to be a 6.
Nice kata to practice working on objects. Time-consuming but worthwhile. Could be 5 kyu.
This comment is hidden because it contains spoiler information about the solution
How does this work?
Expected: 'MON: 11:00 - 23:00\nTUE - SUN: null - null', instead got: 'MON: 11:00 - 23:00'
Expected: 'MON: 11:00 - 23:00\nTUE - SAT: null - null\nSUN: 11:00 - 23:00', instead got: 'MON: 11:00 - 23:00\nSUN: 11:00 - 23:00'
Expected: 'MON - TUE: 11:00 - 23:00\nWED - FRI: null - null\nSAT - SUN: 11:00 - 23:00', instead got: 'MON - TUE: 11:00 - 23:00\nSAT - SUN: 11:00 - 23:00'
Why expected output has unknown word: null??? 'null' really confuses me.
Returning empty array for empty timetable makes no sense whatsoever. It should return empty string.
Test cases starting from the 5th are vulnerable to input modification.
I passed all tests, but have the error:
TypeError: d.toUpperCase is not a function
Can you help with this issue?
This kata was challenging for me, but I enjoyed it very much and learned a lot. Also, I think this one was very well crafted. A complex problem to solve, but not because it was hard to figure out what the problem was asking for. Well done.
Ah, okay. Strictly, the wording is correct, but it's easily misread. Maybe some tweaking of the wording would help? But re-reading it, it makes sense.
It shouldn't be concatinated because working days will be only Monday and Friday not all days from Monday to Friday.
And seems that you've put logic for this right here: if ... (last.order === d.order - 1), please correct me if I'm wrong.
if ... (last.order === d.order - 1)
Thank for notice about empty array, probably null will be better.
"You may be given an array only of Monday and Friday with the same hours, but they shouldn't be concatenated." --Why? And what about such a situation should mean nothing would be concatenated? I haven't put any logic in that handles this, and it passed just fine.
"If the array is empty, it just returns an empty array." --Seems strange to return a different format type (other than something like null). I would've thought we'd return an empty string, as if it were a blank sign for the working hours.
No problems, thank you a lot!