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

西雅图打卡

🔗
 楼主| deepforce 2019-10-26 12:56:15 | 只看该作者
全局:
1192. Critical Connections in a Network
Problem: Return all critical connections in the network in any order.
Solution: Tajan algorithm
其实也就是找SCC
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-26 15:26:13 | 只看该作者
全局:
957. Prison Cells After N Days
Problem: Given the initial state of the prison, return the state of the prison after N days (and N such changes described above.)
Solution: MOD 14
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-28 04:14:40 | 只看该作者
全局:
635. Design Log Storage System
Problem: Return the id of logs whose timestamps are within the range from start to end.
Solution: hash + compare by keyword
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-28 06:13:10 | 只看该作者
全局:
780. Reaching Points
Problem: Given a starting point (sx, sy) and a target point (tx, ty), return True if and only if a sequence of moves exists to transform the point (sx, sy) to (tx, ty). Otherwise, return False.
Solution: 反过来找,通过modulo找到(x, kx+y) or (ky+x, y) 再进行判断,O(log(n))
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-28 06:53:16 | 只看该作者
全局:
256. Paint House
Problem: Find the minimum cost to paint all houses.
Solution: DP
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-28 08:15:50 | 只看该作者
全局:
920. Number of Music Playlists
Problem: Return the number of possible playlists.  
Solution: DP, combinations
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-28 09:41:30 | 只看该作者
全局:
945. Minimum Increment to Make Array Unique
Problem:Return the least number of moves to make every value in A unique.
Solution:Sort or Count
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-2 10:47:20 | 只看该作者
全局:
739. Daily Temperatures
Problem: Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 instead.
Solution: Monotonous stack
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-6 16:48:47 | 只看该作者
全局:
上周的Contest
1247. Minimum Swaps to Make Strings Equal
Problem: Return the minimum number of swaps required to make s1 and s2 equal, or return -1 if it is impossible to do so.
Solution: 统计两字符串同一位置(x,y)和(y,x)数目,两个分别除以2后得到至少要交换的次数,再判断%2是否都为1,是则再加2。其余情况都为-1

1248. Count Number of Nice Subarrays
Problem: Given an array of integers nums and an integer k. A subarray is called nice if there are k odd numbers on it.
Return the number of nice sub-arrays.
Solution: sliding window, 统计恰好为K可以变成至多为K减去至多为K-1.
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-8 11:47:43 | 只看该作者
全局:
University Career Fair (Twitter)
Problem: Given each company's start time and durations, return the maximum events can be held in the university.
Solution: Interval scheduling (Greedy)
回复

使用道具 举报

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

本版积分规则

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