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

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

🔗
 楼主| Zeophy 2018-12-16 23:32:57 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-17 23:38 编辑

Day11

No proceeding with G and no surprise. Fight on and better prepared next time.

Solved 508.
Big weather in Bay Area. Take my wife to Anu Nuevo for elephant seal seeing.
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-18 02:59:44 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-19 00:16 编辑

Day12

Beautiful day in Bay Area.

Solved 517.


The idea is to calculate the net surplus or deficit in terms of dresses for a group of machines from 0 to i.

Note that from this group of machines, the maximum output/input throughput is 1/per move. So the minimal number of steps to make the surplus/deficit balanced is abs(surplus or deficit)

        Within that group, the minimal number of steps to make each individual machine balanced is the:
        max(machines-dress_per_machine, (dress_per_machine/machines[i])//2)
        because for machines with surplus, the max output throughput is 1/per move
                                        with deficit, the max input throughput is 2/per move
        The final answer is the max of above both
[/i]
[i]Solved 221. A brutal force solution can be O(n^3). Need something smarter.[/i]

[i]Solved 658. Binary search + two pointers. O(max(k, logn)) solution.[/i]

Solved 532.
Solved 32.
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-19 00:20:05 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-19 10:44 编辑

Day13

Planned paper revision today and tomorrow.

Solved 45 and 55. Good to learn that BFS solves problems that are so tempting to solve with DP.
Solved 12+13 on the way to work.

Solved 71 with stack.
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-20 03:17:35 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-20 09:05 编辑

Day14

Unbelievably light traffic on 101.

Solved 536,537,538.
Solved 545.

Key idea is to get the leaves first and
        decide the boundary condition based on existence of left/right subtree

回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-21 01:12:48 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-21 12:46 编辑

Day15

Headed to Vegas today and keep leeting.

Solved 617, 24, 25. Recursive method solves LinkedList problem so aptly whereas limited by the depth of recursion stack.
Solved 640 with regex. Regex is so powerful!
回复

使用道具 举报

🔗
Scala688 2018-12-21 06:55:12 | 只看该作者
全局:
        给你点个赞!
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-22 01:01:54 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-22 14:16 编辑

Day16.

6th time in Vegas. Keep leeting.

Solved 645.
Solved 646. DP solution TLE and then I realized this is just simply the same problem as interval scheduling (very first problem in Intro 2 Algorithm) which EDF is the greedy solution to it.
Solved 716. The key idea is to push (element, maxsofar, maxidx) to stack.



回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-22 14:20:44 | 只看该作者
全局:
Day 16.

Surprised that my previous post is gone.

Solved 645, 646 (Interval scheduling), 716 (push (cur, maxsofar, maxid)).
回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-23 15:24:09 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-23 16:12 编辑

Day17.

Visited Page and antelop canyon. Amazing place.
Exhausting day and had a dead batter in middle of nowhere. Managed to jumpstart the car.

Solved 38.
Solved 347 with bucket sort



回复

使用道具 举报

🔗
 楼主| Zeophy 2018-12-24 00:23:04 | 只看该作者
全局:
本帖最后由 Zeophy 于 2018-12-24 11:59 编辑

Day18.

Leeting before heading out.

Solved 661.

Solved 662 with BFS + pair + leftmost/rightmost index record keeping.

Solved 663 with two pass. First pass get the all sums and second pass check if a substree sums up to half of the all sums.

Leetcode down.....
回复

使用道具 举报

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

本版积分规则

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