wrote code for square round 1 phone interview