📣 黑五网一特惠|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 24
跳转到指定楼层
上一主题 下一主题
收起左侧

巨婴 6月OA 新题?

🔗
匿名用户-HKCFA  2024-6-11 20:31:44 |倒序浏览
👏 2
👋 1

2024(4-6月) 码农类General 硕士 全职@microsoft - 猎头 - 在线笔试  | 😐 Neutral 🙂 Easy | Other | 在职跳槽

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

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

x
本帖最后由 匿名 于 2024-6-11 20:39 编辑

6月4号收到hr reach out
5号收到OA
貌似是新题??
好长时间没登录了,如果觉得有用求加米!

Task 1
Given A = ["toast", "bread", "breada", "cheese"] and S = "abcdeeghrs", the function should return 2. With our ingredients, recipes "bread" and "cheese" can be prepared (note that it is not necessary to create both at the same time). We cannot prepare "toast" as some ingredients are missing (for example 't'), and there are not enough units of 'a' to prepare "breada".

Given A = ["az", "azz", "zza", "zzz", "zzzz"] and S = "azzz", the function should return 4. With our ingredients, we can prepare "az", "azz", "zza" and "zzz".

Assume that:

N is an integer within the range [1..100];
the length of string S is within the range [0..100];
the length of every string in array A is within the range [1..100];
the elements of A are all distinct;
string S and every string in array A consist only of lowercase letters (a-z).
You are giv
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
e a function:

java
复制代码
class Solution { public int solution(int A, int B, int C, int D); }
that, given four integers A, B, C and D (describing the four digits), returns the number of valid times that can be displayed on a digital clock.

Examples:

Given A = 1, B = 8, C = 3, D = 2, the function should return 6. The valid times are: 12:38, 13:28, 18:23, 18:32, 21:38 and 23:18.
Given A = 2, B = 3, C = 3, D = 2, the function should return 3. The valid times are: 22:33, 23:23 and 23:32.
Given A = 6, B = 2, C = 4, D = 7, the function should return 0. It is not possible to display any valid time using the given digits.
Assume that:

A, B, C and D are integers within the range [0..9].

评分

参与人数 14大米 +20 收起 理由
hanroro + 1 给你点个赞!
leecx22 + 1 很有用的信息!
J-fighting + 2 给你点个赞!
ouch010 + 1 很有用的信息!
Vittoria + 1 给你点个赞!

查看全部评分


上一篇:巨婴 6月OA 新题?
下一篇:Headlands 挂经
推荐
树莓kk 2024-7-13 02:43:51 | 只看该作者
全局:
RunningPig 发表于 2024-6-20 13:24
第三题handle duplicate除了用set有什么好的优化方式么

在backtracing里面loop的时候track一下当前的数字和上一个数字是否相同 然后skip一下,此之谓同层剪枝。
回复

使用道具 举报

地里匿名用户
推荐
匿名用户-XQUX1  2024-6-24 07:57:05
sobrian174 发表于 2024-6-17 12:30
Task 2 中有什么错误?

感觉楼主贴出来的是已经改正的,根据这个https://www.reddit.com/r/learnprogramming/comments/fpnokm/finding_the_bug/
那个current_sum = 0是if max_sum < current_sum条件下的,而不是if item < 0 条件下的

评分

参与人数 2大米 +2 收起 理由
xiaoxiaoJ + 1 给你点个赞!
icecho + 1 很有用的信息!

查看全部评分

回复

使用道具 举报

地里匿名用户
推荐
匿名用户-HKCFA  2024-6-14 01:40:22
问问大家,怎么编辑这个已经发出来的帖子。

我想加个最低大米查看权限,filter一下来地里偷看的叁歌哥们
回复

使用道具 举报

全局:
想问下task 1里,S = "abcdeeghrs" 是不是也没有足够的e来prepare  "cheese"?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-HKCFA  2024-6-12 12:52:05 来自APP
月球那半边 发表于 2024-06-11 18:09:35
想问下task 1里,S = "abcdeeghrs" 是不是也没有足够的e来prepare  "cheese"?
是的。个数也要>= dictionary的
回复

使用道具 举报

全局:
请问巨婴的OA是hackerrank吗?还是什么网站呢?
回复

使用道具 举报

🔗
zzw12345 2024-6-13 05:20:22 | 只看该作者
全局:
楼主oa过了吗
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-HKCFA  2024-6-13 17:16:40 来自APP
过了,在约vo
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-HKCFA  2024-6-13 17:16:57 来自APP
Matisse 发表于 2024-06-12 09:56:09
请问巨婴的OA是hackerrank吗?还是什么网站呢?
codility
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-UCEUW  2024-6-16 14:08:59
问下LZ第三题是用的backtrack吗,有啥优化没有,我用的backtrack没有任何优化,最后挂了,不知道为什么。。。
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-HKCFA  2024-6-16 22:04:27 来自APP
匿名用户 发表于 2024-06-15 23:08:59
问下LZ第三题是用的backtrack吗,有啥优化没有,我用的backtrack没有任何优化,最后挂了,不知道为什么。。。
我也用的bt, 没有优化

可能你有些Corner case没cover到?不太清楚。
回复

使用道具 举报

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

本版积分规则

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