注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
本帖最后由 匿名 于 2025-2-12 14:40 编辑
一共四轮的full-loop
Coding 1:
- Define “change direction” as the number in the array changes monotonicity (strictly greater than or less than the previous number in the array), the algorithm should return the total number of direction changes.
Example 1: (edge case)
Input = [1,1,1,1]
Output = 1
Explain您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 使用VIP即刻解锁阅读权限或查看其他获取积分的方式 游客,您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 VIP即刻解锁阅读权限 或 查看其他获取积分的方式 alendar = [H, W, W, H, H], PTO = 1
Output: 3
Example 2:
Input: calendar = [H, W, W, W, H], PTO = 2
Output: 3
(不知道是不是Leetcode原题,sliding window变种吧)
上周面的,这周就出结果了,倒是很快。
祝各位面试顺利,鱿鱼游戏开始了!
麻烦观众老爷们一键三连,啊不加加米!!! |