Boston Byte Interview Question

explain the code which you have written?