摘要: 一、前言 二、题717 1-bit and 2-bit Characters We have two special characters. The first character can be represented by one bit 0. The second character can b 阅读全文
posted @ 2017-11-14 22:12 小漾儿 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 一、前言 二、题695 Max Area of Island Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directional 阅读全文
posted @ 2017-11-14 16:39 小漾儿 阅读(414) 评论(0) 推荐(0) 编辑
摘要: 一、前言 二、题485 Max Consecutive Ones Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will 阅读全文
posted @ 2017-11-14 16:35 小漾儿 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 一、前言 二、题566 Reshape the Matrix In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different s 阅读全文
posted @ 2017-11-14 16:04 小漾儿 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 一、前言 二、题561 Array Partition I Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ... 阅读全文
posted @ 2017-11-14 15:39 小漾儿 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 一、前言 题是上周五做的,开始思路有点问题,考虑不全,导致submit了3次才AC。 二、题283 Move Zeroes Given an array nums, write a function to move all 0's to the end of it while maintaining 阅读全文
posted @ 2016-05-23 16:15 小漾儿 阅读(1352) 评论(0) 推荐(0) 编辑
摘要: 一、前言 对于这类抽象问题还有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) 编辑