My code for Jian Zhi Offer