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

西雅图打卡

🔗
 楼主| deepforce 2019-11-8 18:17:22 | 只看该作者
全局:
1052. Grumpy Bookstore Owner
Problem: Return the maximum number of customers that can be satisfied throughout the day.
Solution: Sliding Window
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-8 18:30:41 | 只看该作者
全局:
991. Broken Calculator
Problem: Return the minimum number of operations needed to display the number Y.
Solution: Greedy (judged by two conditions: even and odd)
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-8 20:06:09 | 只看该作者
全局:
564. Find the Closest Palindrome
Problem: Given an integer n, find the closest integer (not including itself), which is a palindrome.
Solution: Math, there are 3 conditions to make Palindrome
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-9 13:13:24 | 只看该作者
全局:
403. Frog Jump
Problem: Given a list of stones' positions (in units) in sorted ascending order, determine if the frog is able to cross the river by landing on the last stone.
Solution: DP(AC), DFS(TLE)
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-10 19:00:30 | 只看该作者
全局:
713. Subarray Product Less Than K
Problem: Your are given an array of positive integers nums. Count and print the number of (contiguous) subarrays where the product of all the elements in the subarray is less than k.
Solution: Sliding window
凡是求subarray小于或等于K的,都跟Sliding window可以联系上
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-14 19:59:13 | 只看该作者
全局:
103. Binary Tree Zigzag Level Order Traversal
Problem: Given a binary tree, return the zigzag level order traversal of its nodes' values.
Solution: queue+q.size() vector
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-17 11:19:52 | 只看该作者
全局:
1072. Flip Columns For Maximum Number of Equal Rows
Problem: Return the maximum number of rows that have all values equal after some number of flips.
Solution: Find patterns of each row (xor same)
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-22 12:10:45 | 只看该作者
全局:
1260. Shift 2D Grid
Problem: Given a 2D grid of size n * m and an integer k. You need to shift the grid k times.
Solution: 计算shift后各个元素最后出现位置
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-22 12:20:42 | 只看该作者
全局:
1261. Find Elements in a Contaminated Binary Tree
Problem: Given a binary tree with the following rules
Solution: use set
回复

使用道具 举报

🔗
 楼主| deepforce 2019-11-29 22:02:18 | 只看该作者
全局:
1268. Search Suggestions System
Problem: Given an array of strings products and a string searchWord.
Solution: 不用Trie,直接排序后找出当前输入字符串最匹配的那个,连续取三个,亚麻OA好像也出现过的样子

1267. Count Servers that Communicate
Problem: Return the number of servers that communicate with any other server.
Solution: 统计columns和rows是否存在1,(m+n),然后m*n判断为1时行列是否存在1.

1114. Print in Order
Problem: Design a mechanism and modify the program to ensure that second() is executed after first(), and third() is executed after second().
Solution: multithreading, c++用的是condition variable判断和唤醒

1266. Minimum Time Visiting All Points
Problem: Your task is to find the minimum time in seconds to visit all points.
Solution: 可横,竖,斜着走,所以直接判断max(横,竖)
回复

使用道具 举报

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

本版积分规则

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