My implementation of a coding test