Implementation of Easy #191 challenge.