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

IBM 24intern OA___General Software Developer

全局:

2023(10-12月) 工程类 硕士 实习@ibm - 网上海投 - 在线笔试  | 😃 Positive 🙂 Easy | Pass | 其他

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

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

x
如题,申请的是24Technology Engineer Intern,同时收到了一个不限时的性格测试,大概30min可做完
OA 是60min 两道easy题,pass后收到了video assessment还没做
Question 1

Start with an initial string of zeros. Choose any digit to flip. When a digit is flipped, its value and those to the right switch state between 0 and 1. Given a target string of binary digits, determine the minimum number of flips required to achieve the target.

Example:
Target = 01011
Start with a string of 5 zeros, the same length string as the target.
Initial String -> 00000
Flip the 3rd digit -> 00111
Flip the 2nd digit -> 01000
Flip the 4th digit -> 01011
3 flips are required to reach the target. The return value is 3.

Function Description
Complete the function minimumFlips in the editor below.

minimumFlips has the following parameter(s):
      String target: a string of 0s and 1s to match
Returns:
      Int: the minimum number of flips needed to obtain the target string

Input Format for Custom Testing
The first line contains an integer, n, the length of the target
The next line contains a string, target
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
Stdin        Function
5 ->          numbers[] size n = 5
75 ->        numbers = [75, 80, 99, 100, 50]
80
99
100
50

Sample Output0
LXXV
LXXX
XCIX
C
L

Explanation 1
We preform the following n = 5 conversions on the array [75, 80, 99, 100, 50]
0. numbers[0] = 75 corresponds to Roman numeral LXXV, L(50) + X(10) + X(10) + V(5)
1. numbers[1] = 80 corresponds to Roman numeral LXXX, L(50) + X(10) + X(10) + X(10)
2. numbers[2] = 99 corresponds to Roman numeral XCIX,XC(90) + IX(9)
3. numbers[3] = 100 corresponds to Roman numeral C
4. numbers[4] = 50 corresponds to Roman numeral L.
Return the array [LXXV, LXXX, XCIX, C, L]  as the answer

评分

参与人数 2大米 +26 收起 理由
gallagherwww + 1 欢迎分享你知道的情况,会给更多积分奖励!
匿名用户-RJ8Q9 + 25 欢迎分享你知道的情况,会给更多大米奖励!

查看全部评分


上一篇:求一个Databricks architecture interview 的面经
下一篇:请问TT从verbal offer到written offer大概要等多久?
🔗
 楼主| 小亩_f2c0061 2023-10-26 13:22:29 | 只看该作者
全局:
新人求加米hhh
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-QNWYW  2023-10-27 10:44:49
请问OA后多久收到video的啊
回复

使用道具 举报

🔗
 楼主| 小亩_f2c0061 2023-10-30 01:46:31 | 只看该作者
全局:
匿名用户 发表于 2023-10-26 19:44
请问OA后多久收到video的啊

我是做完oa当天收到的
回复

使用道具 举报

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

本版积分规则

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