I found the solution quite impressive, but I think it is the typical junior developer mistake of getting too smart with their code.
As an interviewer who is going to have to work with the candidate in case they get hired, I would worry that this kind of code would be what I'd need to review on a daily basis.
The requirements were weird, but when are they ever not? and read-ability and maintain-ability were clearly stated as priorities at the start..
As an interviewer who is going to have to work with the candidate in case they get hired, I would worry that this kind of code would be what I'd need to review on a daily basis.
The requirements were weird, but when are they ever not? and read-ability and maintain-ability were clearly stated as priorities at the start..
Still, props for the cleverness.