




付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、 亚马逊 2022 技术岗面试题第1题: A standard 52-card deck, which contains 2, 3, , J, Q, K, A. Pick four cards from the deck as a hand. Provide a function to figure out who is the winner of given two hands. There are different types: T1. Any four cards of the same rank. In this type, the bigger card decides who w
2、ins. For example: 3,3,3,3 6,6,6,6 第2题: T2. Any string with all four cards, and in such case (consecutive), A can count as either a high or a low card. Otherwise, A is a highest card. In this type, the highest card decides who wins. For example: A,2,3,4 J,Q,K,A 第3题: T3. Any three cards of the same ra
3、nk, In this type, the higher three same cards wins. For example: 3,3,3,2 2,2,2,A 第4题: T4. Any two cards of the same rank together with another two cards of the same rank. In this type, if two hands share same higher Pair, the bigger another Pair decides who wins. Otherwise, bigger Pair wins. For exa
4、mple: 3,3,4,4 4,2,4,2 第5题: T5. Any two cards of the same rank. In this type, bigger Pair wins. If two hands share same Pair, the bigger Third decides who wins. Otherwise, the bigger Fourth wins. For example: 3,3,7,4 3,3,7,5 第6题: T6. Any hand not in the above-mentioned hands. In this type, the highes
5、t card decides who wins. For example: A,K,Q,9 10,Q,A,K We dont take the suit into consideration. If two hands in different type, the rule is: T1T2T3T4T5T6 You will get two lines as input: 6,3,4,5 3,4,5,6 You should output the result: 0 If the first two line is bigger than the second line, the result
6、 should be 1. If the first line is smaller than the second line, the result should be -1. If they are equal, you should return 0. If a participator cheats in this game, the number of the same card will be more than four in the two hands. In this case, you should return -2. Symmetric number is a kind
7、 of non-negative number which looks the same as its inversion. For example, ”12321”is a symmetric number. Given any number n represented by a string, find the next symmetric number which is bigger than n. Here are two examples, Sample 1: Input: 123 Output: 131 Sample 2: Input: 12321 Output: 12421 第7
8、题: Common Ancestor(Programming) Question: A endless Complete Trinary Tree. Node ID is its back-and-forth order in level travel. Find the closest common ancestor. (“Complete Trinary” means each node has three children, neither more or less) Example: The node 13 and 15 have a closest common parent12 The node 16 and 10 have a closest common parent 1 If one Node is the ancestor of the another one, that Node is the clos
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 江西加油罐采购合同范本
- 锡山区餐饮投资合同范本
- 物业空调安装免责协议书
- 灌溉水渠修复协议书范本
- 用工程货款买房合同范本
- 法律欠款回收协议书范本
- 腻子工工程分包合同范本
- 父母卖房给子女合同范本
- 机械厂临时工合同协议书
- 砖窑摊位转让协议书模板
- 京沪高铁某段现浇箱梁施工方案
- 企业用工风险劳动合同风险防控培训课件
- GB/T 5053.3-2006道路车辆牵引车与挂车之间电连接器定义、试验方法和要求
- 加工中心个人简历
- 最新《工会基础知识》试题库及答案1000题【完美打印版】
- 高周波熔接机操作指导书
- 产钳助产术考核标准
- T∕CCTA 30101-2021 喷气涡流纺棉本色纱
- 上海石化挤出机组交流材料概要课件
- 医院关于成立食堂食品安全领导小组的通知
- 《村卫生室管理办法(试行)》课件(PPT 49页)
评论
0/150
提交评论