摘要: bool isHappy(int n) { // If not happy, it will finally recycle in the checkList. array checkList{4,16,37,58,89,145,42,20}; auto caculate ... 阅读全文
posted @ 2015-08-06 15:24 wu_overflow 阅读(280) 评论(0) 推荐(0)
摘要: 链表和树都自带递归特性,我很喜欢。这一题很简单,有意思的是我是先把内部的 lambda 表达式写出来之后才发现可以直接用这个函数本身做递归。ListNode* removeElements(ListNode* head, int val) { if (head == nullptr){ ... 阅读全文
posted @ 2015-08-06 13:53 wu_overflow 阅读(128) 评论(0) 推荐(0)