楼主: ge-smile
跳转到指定楼层
上一主题 下一主题
收起左侧

开刷LeetCode,开贴自我督促~有兴趣者可加入

🔗
 楼主| ge-smile 2015-2-18 02:05:05 | 只看该作者
全局:
刚做完amazon OA。最近在努力刷面经。。
Compare Version Numbers
理解好题意。不是直接比大小,是以点为间隔,取出每个间隔中的数字进行大小比较。先比较长度大小,相等情况下,再进行每位上数字大小的比较。tricky
参考曹神的办法做的。很巧妙的算法
Count and Say
没读一个数字跟下一个比较,相同则个数++,不同则继续。在返回的string里只数出个数和数字
改变string要用 str+=**;

回复

使用道具 举报

🔗
 楼主| ge-smile 2015-2-22 07:34:25 | 只看该作者
全局:
最近一直刷题,但是可能就不坚持每天往地里更新了,隔几天更新一次。。currently40/178
Climbing Stairs
same as fibonacci number: 1) recursive ->2) dp ->3)use three variable to save space

Implement strStr()
brute Force.两层循环。
需要找到的needle如果为空,则返回0. haystack为空活着小于needle长度返回-1 确定何时退出。break/continue 区别。
Valid Parentheses
push to stack when ({[ , pop and check when )}]
input something random at first, in case check ] … at first
Set Matrix Zeroes
use row 0 and column 0 to store the result. if(matrix[i][j] == 0) then matrix[i][0] = 0, matrix[0][j] = 0
rows 0 and columns 0 need to be a separate case. Find if they have 0 or not. Assign value 0 later
Find Minimum in Rotated Sorted Array ||
if a[left] > a[right], it is ordered, return a[left]. if a[left] < a[right], find whether left or right part is organized(middle).



Searched in rotated array
binary search. only half is sorted, the other half is not. so need to decide it is in the sorted or unsorted side
the condition of stopping while loop. what idx should be left or right
Unique Paths
have a m*n matrix to store the number of unique paths. Dynamic programming
assign value 1 to 0 array and 0 column.
Unique Paths II
just compute to the given matrix, if it is 1. then dp[j] should be 0
the 0 row should not be 1 any more. also it should be dp[j] = dp[j-1] if the given matrix at this point is 1

回复

使用道具 举报

🔗
 楼主| ge-smile 2015-3-15 04:31:02 | 只看该作者
全局:
最近忙着面Amazon,各种刷面经去了,也都没来的及更新帖子。面完以后就去准备期中考试。空白了两个周。。

现在回归刷题。。目前进度55/181.。。。Leetcode数目这是在不断增加的节奏。跪。
回复

使用道具 举报

🔗
somnusfish 2015-3-30 18:34:28 | 只看该作者
全局:
我打算一天刷一道吧。C写得比较熟,打算转java。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表