Facebook challenge problem solved