摘要: 一、前言 对于这类抽象问题还有self用法,还要多做多练习,此题是参考其他答案所做。 二、题104 Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the n 阅读全文
posted @ 2016-05-19 18:29 小漾儿 阅读(689) 评论(0) 推荐(0) 编辑
摘要: 一、前言 做这题有个小收获,关于Digital root的解法,有个极方便的小公式: 二、题258 Add Digits Given a non-negative integer num, repeatedly add all its digits until the result has only 阅读全文
posted @ 2016-05-19 18:23 小漾儿 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 一、前言 做了两题才慢慢摸清了leetcode的操作。 二、题349 Intersection of Two Arrays Given two arrays, write a function to compute their intersection. 其实前两题不难,思路也还比较清晰。 阅读全文
posted @ 2016-05-19 18:13 小漾儿 阅读(588) 评论(0) 推荐(0) 编辑
摘要: 一、前言 不是计算机专业出身,却有一颗程序猿的心。 昨日开始leetcode第一次刷题,选择了菜鸟方式,从AC率最高且难度为Easy的题开始,不管题是简单还是难,都想做个记录,既是方便以后回顾,又是以此作为一个激励,督促自己每天都能有所进步。 二、题344 Reverse String Write 阅读全文
posted @ 2016-05-19 18:08 小漾儿 阅读(772) 评论(0) 推荐(0) 编辑