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

New grad tictok OA general

全局:

2024(10-12月) 码农类General 硕士 全职@Bytedance - 网上海投 - 在线笔试  | 😐 Neutral 😐 Average | Other | 应届毕业生

我拿到的是IOS developer, new grad, 但是给的OA 也是 general。 他家OA只要准备就不难。求加米, 加油

6. TikTok Balanced Clips
TikTok creates random clips made up of lowercase English letters.
A clip is called "smooth" if the difference between any two letters next to each other is not bigger
than a number called diff.
The difference between two letters, xxx and yyy, is how far apart they are in the alphabet. For
example, the difference between 'a' and 'z' is 25, and between 'f' and 'c' is 3.
i.e. If diff = 3, then the clip "ac" is smooth because the difference between 'a' and 'c' is 2, which
is less than or equal to 3. However, the clip "az" is not smooth because the difference between
'a' and 'z' is 25, which is greater than 3.
You are given two numbers: clipLength (the number of letters in the clip) and diff (the
maximum allowed difference between two letters next to each other). Your job is to find how
many smooth clips of length clipLength can be made. Since the number could be very large,
give the answer as the result modulo 109+710^9
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
or below.
getMinTikTokServerNetworkCost has the following parameters:
  • int x[n]: The x-coordinates of the servers
  • int y[n]: The y-coordinates of the servers



Here's a solution for the TikTok Server Network Optimization problem in both C++ and Java. This problem is essentially about finding the minimum spanning tree (MST) for a graph where the nodes are servers and the edges between servers represent the minimum of either the x or y difference.


本帖子中包含更多资源

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

x

评分

参与人数 2大米 +12 收起 理由
匿名用户-IPWSY + 10 欢迎分享你知道的情况,会给更多大米奖励!
ErnestWang + 2 给你点个赞!

查看全部评分


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

本版积分规则

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