




付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 互动式教学工具的营销策略与教育内容创新
- 抖音商户直播设备故障应急切换制度
- 全球视野下2025年跨文化交流能力在国际化教育中的核心地位报告
- 公交优先发展战略2025:城市交通拥堵治理中的公共交通与公共交通市场拓展研究报告
- CLK2-3-IN-1-生命科学试剂-MCE
- 陕西青年职业学院《口译理论与实践》2023-2024学年第一学期期末试卷
- 新疆农业职业技术学院《基础泰语》2023-2024学年第一学期期末试卷
- 宣城职业技术学院《烟草文化》2023-2024学年第一学期期末试卷
- 公共卫生应急物资储备体系建设2025年实施方案与信息化建设报告
- 吉林省长春市新区2024-2025学年九年级化学第一学期期末质量检测模拟试题含解析
- 河南交通投资集团有限公司招聘笔试真题2024
- 呼吸康复讲课
- 互联网女皇AI报告:人工智能趋势报告(双语翻译版本)
- 2025年西藏事业单位招聘考试职业能力倾向测验试卷(民族医药类)
- T/COSHA 12-2022研学旅行安全工作规范
- T/CIE 149-2022霍尔电推进系统点火测试规范
- 200句记忆高中英语3500词(语法填空练习)
- 铁路集装箱运输中存在的问题分析与对策探讨
- 2025年人类学与社会学专业期末考试试题及答案
- 3年级数学测试卷及答案
- 2025四川遂宁发展投资集团有限公司招聘8人笔试参考题库附带答案详解
评论
0/150
提交评论