📣 独立日限时特惠: VIP通行证立减$68
楼主: Zeophy
跳转到指定楼层
上一主题 下一主题
收起左侧

2018-12 在职刷题保持状态, 每天1题+ML insights

🔗
 楼主| Zeophy 2018-12-25 00:09:49 | 只看该作者
全局:
Day19.

Solved 725.
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-26 01:09:38 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-26 01:44 编辑

Day20,

Headed back to Bay Area yesterday being exhausted. Unable to solve more problems. Will make this up today.

Merry Xmas!

Solved 746, 252, 682
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-26 17:00:12 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-27 13:28 编辑

Day21.

Solved 353.
Solved 738 with Binary Search.

Solved 652.
回复

使用道具 举报

无效楼层,该帖已经被删除
🔗
dizhufengzhi 2018-12-27 13:33:58 | 只看该作者
全局:
加油,祝楼主天天有进步
回复

使用道具 举报

🔗
dizhufengzhi 2018-12-27 13:34:23 | 只看该作者
全局:
拿到offer请回地里报喜
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-27 13:46:07 | 只看该作者
全局:
dizhufengzhi 发表于 2018-12-27 13:33
加油,祝楼主天天有进步

Thanks!!
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-27 13:46:21 | 只看该作者
全局:
dizhufengzhi 发表于 2018-12-27 13:34
拿到offer请回地里报喜

一定一定!
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-28 00:53:06 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-28 14:16 编辑

Day22

Solved 762 and learned bit masking.
Solved 771.

Solved 775 with O(n) by keeping a record of largest and second largest number so far.  Note that all local inversions are also global inversions. So check if non-local inversion exists.

If current A is the largest so far, continue. if A[i] is smaller than second largest so far, return False as there are at least one non-local inversion exists.

If second < A[i] < largest -> check if A[i-1] is the largest. Otherwise, at least one non-local inversion exists.
[/i][/i][/i]
[i][i][i]A more general solution can be built with Divide and Conquer in O(nlogn) that counts the global inversions and make no assumption of the member of the array.
[/i][/i]
回复

使用道具 举报

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

本版积分规则

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