Add my solution

See the appended test case on how to use the function