一亩三分地论坛

 找回密码
 获取更多干货,去instant注册!

一亩三分地官方iOS手机应用下载
查看: 629|回复: 0
收起左侧

Twitter OA

[复制链接] |试试Instant~ |关注本帖
tyang12 发表于 2016-4-29 02:06:02 | 显示全部楼层 |阅读模式

2016(1-3月) 码农类 硕士 全职@Twitter - 校园招聘会 - 在线笔试 |Otherfresh grad应届毕业生

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

您需要 登录 才可以下载或查看,没有帐号?获取更多干货,去instant注册!

x
突然发现上个月的作的twitter OA还没发,一样是60mins 两题,. 1point 3acres 璁哄潧
第一题:.鏈枃鍘熷垱鑷1point3acres璁哄潧
Input format:
N        // count of number in the input
d[0]        //1st number
d[1]        //2nd number
... 鏉ユ簮涓浜.涓夊垎鍦拌鍧.
d[n-1]        //last number


. 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴Output format:. 1point 3acres 璁哄潧
The first line contains a string of n bits, where the i-th bit (as read from left to right) indicates if there is any number before b which is equal to b.
The second line contains a string of n bits, where the i-th bit (as read from left to right) indicates if there is any number after b which is equal to b.

Sample input:
6        //total 6 numbers given below
1. Waral 鍗氬鏈夋洿澶氭枃绔,
3
2. 1point 3acres 璁哄潧
3
4
1
鏉ユ簮涓浜.涓夊垎鍦拌鍧.
Sample output:
000101
110000


这题我在做之前看地里其他帖子分享过,我是用HashSet来做

第二題:.鏈枃鍘熷垱鑷1point3acres璁哄潧
Return the count of numbers X in the range 1<=X<=N that satisfy the following property:
(X-1) !  % X = X-1-google 1point3acres

Input Parameter:
A single integer N

Constraints:
1 <= N <= 10^5
. 1point3acres.com/bbs
Output Format:
A single integer which in the count of the numbers that satisfy the above property.

Sample Input:
2
Sample Output:
2

Sample Input:
4
Sample Output:
3

这题我作之前没看过,所以一看到有点慌,我列了N= 1~7的结果后,猜测就是在找prime number (时间不够,没想到怎么证明...),幸运通过所有test cases,. 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴
------------------------------------------------------------------------

. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴做完后跟地里大家一样填了pre-interview questions,直到4/14才收到信,说这周五前会有消息,等了好久,希望这两天能得到下一步面试啊!!! !
.鐣欏璁哄潧-涓浜-涓夊垎鍦

评分

1

查看全部评分

本帖被以下淘专辑推荐:

本版积分规则

请点这里访问我们的新网站:一亩三分地Instant.

Instant搜索更强大,不扣积分,内容组织的更好更整洁!目前仍在beta版本,努力完善中!反馈请点这里

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明 ( 沪ICP备11015994号 )

custom counter

GMT+8, 2017-2-22 23:19

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

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