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

[其他] 九月刷题给米接龙活动(小伙伴们冲冲冲)

   关闭
🔗
bibleblack 2020-9-12 14:24:05 | 只看该作者
全局:
第四天,四道题
Valid Number: Bad question, did not give enough examples. Be cautious on the decimal point!
Invert Binary Tree: easy. any kind of traversal is working. Don't know why the memory used is always less than only 5%
Cracking the Safe: Very hard. Need to figure out that we can find the answer through finding an Eulerian circle in an equivalent graph ( And it is gauranteed that there is an Eulerian circle). And then DFS
Reorganize String: Sort the count of the char, then put them into the res string, skip one char, and put a char (i+=2). Put the most popular char first, and its count should not larger than N/2

Screen Shot 2020-09-11 at 11.09.45 PM.png (57.9 KB, 下载次数: 0)

Screen Shot 2020-09-11 at 11.09.45 PM.png

评分

参与人数 4大米 +6 收起 理由
3d28 + 2 给你点个赞!
diligentmarch + 1 给你点个赞!
siranjoy119 + 1 给你点个赞!
DL + 2 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
DL 2020-9-12 14:30:21 | 只看该作者
全局:
9/11 打卡第11天, 刷了1道题

152. Maximum Product Subarray
dynamic programming
res = pos = neg = nums[0]
if nums[i]<0  
   pos, neg = neg*nums[i], min(pos*nums[i], nums[i])
elif nums[i]>0
   pos, neg = max(pos*nums[i], nums[i]), neg*nums[i]
else
   pos, neg = 0, 0
res = max(res, pos)

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

image.png

评分

参与人数 3大米 +3 收起 理由
dabaibai + 1 给你点个赞!
index + 1 给你点个赞!
diligentmarch + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
siranjoy119 2020-9-12 14:32:50 | 只看该作者
全局:
9月打卡第11天,5道题
Minimize Rounding Error to Meet Target:先用floor求和,然后算还需要把多少个floor变成ceiling,变成ceil的时候按error从小到大排序就可以了,quickselect当然更优
Smallest Common Region: 典型的找lowest common ancestor题
Design File System: 可以直接用hashmap存,也可以用trie来存省空间
Verifying an Alien Dictionary: 可以把character转化为int list然后比较list
Shortest Path to Get All Keys: 用set记录visited cell,主要也要把key加到set里面。key可以用bit mask来表示

WeChat Screenshot_20200911232906.png (33.13 KB, 下载次数: 0)

WeChat Screenshot_20200911232906.png

评分

参与人数 4大米 +6 收起 理由
siranjoy + 2 给你点个赞!
index + 1 给你点个赞!
3d28 + 2 给你点个赞!
diligentmarch + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
diligentmarch 2020-9-12 14:40:39 | 只看该作者
全局:
刷了两题:
Flip Binary Tree To Match Preorder Traversal
Maximum Product Subarray

现在太忙了

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

image.png

评分

参与人数 4大米 +4 收起 理由
leogaogithub + 1 给你点个赞!
Lichens + 1 给你点个赞!
dabaibai + 1 给你点个赞!
index + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
3d28 2020-9-12 14:40:50 | 只看该作者
全局:
今天是OA题目的一天
IPO braze
IPO 股票排序
829 数学题
submatix before and after

评分

参与人数 4大米 +4 收起 理由
Lichens + 1 给你点个赞!
dabaibai + 1 给你点个赞!
println + 1 给你点个赞!
index + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
index 2020-9-12 14:43:11 | 只看该作者
全局:
把segment tree怎么用搞明白了,开心。

评分

参与人数 3大米 +3 收起 理由
leogaogithub + 1 给你点个赞!
Lichens + 1 给你点个赞!
dabaibai + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
dabaibai 2020-9-12 14:54:06 | 只看该作者
全局:
9月刷题第9天:
matrix dp 系列

评分

参与人数 4大米 +4 收起 理由
ann要加油啊 + 1 给你点个赞!
熊云天 + 1 给你点个赞!
leogaogithub + 1 给你点个赞!
Lichens + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
Lichens 2020-9-12 14:59:07 | 只看该作者
全局:
9/11 打卡第11天
152. Maximum Product Subarray dp,要注意两次负数相乘会得到正值
836. Rectangle Overlap 直接比较坐标就可以
1106. Parsing A Boolean Expression Stack+HashSet

leetcode9-11.png (24.49 KB, 下载次数: 0)

leetcode9-11.png

评分

参与人数 2大米 +3 收起 理由
熊云天 + 2 给你点个赞!
leogaogithub + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
leogaogithub 2020-9-12 15:14:18 | 只看该作者
全局:
9.11 打卡 第一天(昨天+今天)
Minimum Area Rectangle: 矩形对角线,hashset 查两点是否存在
Most Stones Removed with Same Row or Column:最开始想偏了用topological sort,看答案后用union find.

leetcode.com.png (28.87 KB, 下载次数: 0)

leetcode.com.png

评分

参与人数 3大米 +4 收起 理由
amandahubo + 1 给你点个赞!
ann要加油啊 + 1 给你点个赞!
熊云天 + 2 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
Jaqueline-lu 2020-9-12 15:25:37 | 只看该作者
全局:
不知道有没有刷SQL的同学,今天主要还是刷的HackerRank的SQL,一下子做了四题

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

image.png

评分

参与人数 3大米 +4 收起 理由
willy2049 + 1 给你点个赞!
ann要加油啊 + 1 给你点个赞!
熊云天 + 2 给你点个赞!

查看全部评分

回复

使用道具 举报

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

本版积分规则

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