📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
楼主: smilelin
跳转到指定楼层
上一主题 下一主题
收起左侧

[其他] 8月刷题/Mock interview接龙活动(缺米刷题的来)

   关闭
🔗
黑犬默默 2020-8-11 23:43:31 | 只看该作者
全局:
打卡 三道题

Screen Shot 2020-08-11 at 11.42.30 AM.png (199.71 KB, 下载次数: 0)

Screen Shot 2020-08-11 at 11.42.30 AM.png

评分

参与人数 3大米 +3 收起 理由
NightGuard + 1 给你点个赞!
rockwtr + 1 给你点个赞!
speed_secret20 + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

全局:
补昨天:
8月10日打卡第十天 刷题第十天

1.Leetcode 3
Longest Substring Without Repeating Characters

Assumption:
All characters are from 'a' - 'z'

High level:
use two pointers slow and fast to maintain a variable sliding window;
use a HashSet to record all unique characters in the sliding window which consist of the current substring.
record the length of current substring and compare with historical longest;
return the longest one;

Details:
the slow pointer represent the startIndex of substring and the right pointer
represent the endIndex of the current substring;
use an int variable longest to record the historical longest substring, waited to be compared
traverse the string and use a hashSet to store unique characters we had ever met;
as long as the upcoming character hasn't shown before, put it into the hashset;
If the character, eg: c, is already in the hashSet, move the slow pointer and remove
s.charAt(slow), until c can be added into the hashset, compare its current length with
historical longest, update the longest(if applicable)
After the process of traversing has finished, we can return longest.

2. find an element and return its index in a sorted unknown sized array;
-double size the searching range from slow index == 0 and fast index == 1;
-when we fix the searching range, shall we use the classical binary search to find out its index or return -1;

3. Leetcode 2 Generate Parentheses
Approach One:
- use DFS with a stringBuilder to generate all parentheses and put into the list
- until index hit the bottom so we can return the list;

Approach two:
- instead of using a StringBuilder, use a char array and replace each character when necessary;
- for example: if the left brackets still remain, put left brackets into the char; if the right brackets has more remains than left brackets, put right brackets into the char.

疫情持久战,更要努力💪💪💪期待下个十天!

评分

参与人数 3大米 +3 收起 理由
Scott.W + 1 给你点个赞!
NightGuard + 1 给你点个赞!
rockwtr + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
rockwtr 2020-8-12 01:18:57 | 只看该作者
全局:
Day 49, solved 1 problem.

Tip: base 26 number to bash 10 number.

Workspace 1_049.png (9.61 KB, 下载次数: 0)

Workspace 1_049.png

评分

参与人数 3大米 +3 收起 理由
Scott.W + 1 给你点个赞!
Sbrina813VSKC + 1 给你点个赞!
NightGuard + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
NightGuard 2020-8-12 01:25:03 | 只看该作者
全局:
差点忘记发了,做之前刷过一遍的题,好多还是不知道怎么做。。




评分

参与人数 2大米 +2 收起 理由
Sbrina813VSKC + 1 给你点个赞!
rockwtr + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

全局:
8/11 DAY11
274
H-Index
Learning Buckets
66
Plus one

67
Add Binary
Learning StringBuilder

评分

参与人数 4大米 +4 收起 理由
zhang920524 + 1 赞一个
TimLee + 1 给你点个赞!
Scott.W + 1 给你点个赞!
Sbrina813VSKC + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
Sbrina813VSKC 2020-8-12 04:11:36 | 只看该作者
全局:
08/11/2020(Day 2)


评分

参与人数 4大米 +4 收起 理由
abyss + 1 给你点个赞!
zhang920524 + 1 赞一个
TimLee + 1 给你点个赞!
Scott.W + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
Scott.W 2020-8-12 04:26:58 | 只看该作者
全局:
打开第六天!求米!谢谢谢谢!

image.png (202.22 KB, 下载次数: 0)

image.png

评分

参与人数 3大米 +3 收起 理由
abyss + 1 给你点个赞!
zhang920524 + 1 赞一个
TimLee + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
TimLee 2020-8-12 04:58:07 | 只看该作者
全局:
Aug 11 打卡
要好好刷题了,准备10月份的秋招了

Screen Shot 2020-08-11 at 4.51.37 PM.png (226.63 KB, 下载次数: 0)

Screen Shot 2020-08-11 at 4.51.37 PM.png

评分

参与人数 4大米 +4 收起 理由
abyss + 1 给你点个赞!
nazo + 1 给你点个赞!
kateee + 1 给你点个赞!
zhang920524 + 1 赞一个!

查看全部评分

回复

使用道具 举报

🔗
abyss 2020-8-12 06:03:10 | 只看该作者
全局:
8/11/20

274 H-index
Sort and binary search,题目不难,重点是画图讲清楚

979 Distribute Coins in Binary Tree
Helper function returns steps needed and coins needed
Left steps + right steps + abs(left coins needed + right coins needed + root.val - 1)

935 Knight Dialer
NEXT_POS = {1:[6, 8], 2:[7, 9], 3:….}
dp[start][steps_left] = sum([dp[pos][steps_left -1] for pos in NEXT_POS[start]])

评分

参与人数 3大米 +4 收起 理由
ztamber + 2 给你点个赞!
nazo + 1 给你点个赞!
kateee + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
kateee 2020-8-12 06:21:04 | 只看该作者
全局:
8/11
复习了图算法

787. Cheapest Flights Within K Stops    
207. Course Schedule    
210. Course Schedule II 

评分

参与人数 4大米 +4 收起 理由
zhxy222td + 1 给你点个赞!
ztamber + 1 很有用的信息!
dacongy + 1 给你点个赞!
nazo + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

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

本版积分规则

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