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

ZipRecruiter OA

🔗
匿名用户-DV5HJ  2022-10-3 13:51:48 来自APP |倒序浏览

2022(10-12月) 分析|数据科学类 硕士 实习@ziprecruiter - 网上海投 - 在线笔试  | 😐 Neutral 😣 Hard | Fail | 应届毕业生

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
第一题

You are given two positive integers x and y, and a sequence of positive integers numbers. Your task is to change x and y through this process: Iterate through numbers from left to right, subtract each integer numbers[i] from the largest number between x and y (x in case of a tie), or skip numbers[i] if it is greater than both x and y.

Return the number of integers in numbers that will be skipped based on these criteria.. From 1point 3acres bbs

Example

For x = 8, y = 12, and numbers = [5, 6, 6, 3, 1, 1, 2], the output should be solution(x, y, numbers) = 2.

Explanation.google  и

At the beginning, x = 8 and y = 12.
Since x < y currently, processing numbers[0] = 5 results in x = 8 and y = 7.
Since x > y now, processing numbers[1] = 6 results in x = 2 and y = 7.
Since x < y now, processing numbers[2] = 6 results in x = 2 and y = 1.
numbers[3] = 3 will be skipped because it will be greater than both x = 2 and y = 1.
Since x > y now, processing numbers[4] = 1 results in x = 1 and y = 1.
Since x = y now, processing numbers[5] = 1 results in x = 0 and y = 1 (1 is subtracted from x because of the tie).
numbers[6] = 2 will be skipped because it will be greater than both x = 0 and y = 1.
So, since numbers[3] and numbers[6] will be skipped, the final answer is 2.

第二题

Debuggers are a well-known feature of IDEs. When debugging, it is possible to set breakpoints at specific lines within the source code to let the debugger intercept code execution when it reaches this line.

You are given codeLength, which represents the last line number of some code snippet that you are debugging, and a list of sorted unique integers breakpoints representing the line numbers that are set as breakpoints for the debugger. It is guaranteed that all breakpoints are on unique lines and 1 ≤ breakpoints[i] ≤ codeLength.

You are also given a list of actions that the user made. Your task is to determine which line the debugger will end o
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
he grid.. check 1point3acres for more.

Your task is to compute how many 2 × 2 submatrices of the grid contain exactly blackCount black cells, for each 0 ≤ blackCount ≤ 4. As a result, you will return an array of 5 integers, where the ith element is the number of 2 × 2 submatrices with exactly i black cells.. 1point3acres.com
. .и
It is guaranteed that black cell coordinates in the black array are pairwise unique, so the same cell is not colored twice.
. Χ
Example
.google  и
For rows = 3, cols = 3, and black = [[0, 0], [0, 1], [1, 0]], the output should be solution(rows, cols, black) = [1, 2, 0, 1, 0].

Expand to see the example video.

Note: If you are not able to see the video, use this link to access it.

Initially, result = [0, 0, 0, 0, 0].
The 2 × 2 submatrix with the upper-left corner at (0, 0) contains 3 black cells. result = [0, 0, 0, 1, 0].
The 2 × 2 submatrix with the upper-left corner at (0, 1) contains 1 black cell. result = [0, 1, 0, 1, 0].
The 2 × 2 submatrix with the upper-left corner at (1, 0) contains 1 black cell. result = [0, 2, 0, 1, 0].
The 2 × 2 submatrix with the upper-left corner at (1, 1) contains 0 black cells. result = [1, 2, 0, 1, 0].


新人求加米🙏🙏想看面经😭😭😭

评分

参与人数 11大米 +30 收起 理由
loveFISHly + 1 很有用的信息!
body117 + 1 给你点个赞!
微信用户_831b7d2 + 1 给你点个赞!
林克er + 1 很有用的信息!
匿名用户-ZMXQT + 20

查看全部评分


上一篇:ziprecruiter ds codesignal
下一篇:热带雨林 DS店面二面
🔗
annielavender 2022-10-14 05:56:29 | 只看该作者
全局:
求问Q4除了暴力解还有什么更好的方法
回复

使用道具 举报

🔗
justeating 2022-10-19 11:48:15 | 只看该作者
全局:
annielavender 发表于 2022-10-13 14:56
求问Q4除了暴力解还有什么更好的方法

同问!!!!!
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-VJDXU  2022-10-24 05:12:03 来自APP
暴力會超時
回复

使用道具 举报

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

本版积分规则

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