ctci - solution 1