下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年智能电能表及配件项目发展计划
- 2024年射频消融治疗仪项目发展计划
- DB3402-T 69-2024 黄缘闭壳龟生态养殖技术规程
- 2024年金属焊接材料项目合作计划书
- 2024年频率测量仪器项目合作计划书
- 2024年CNG调压设备项目建议书
- 企业安全生产档案
- 山东省滨州市博兴县2024-2025学年六上数学期末达标检测试题含解析
- 山东省菏泽市定陶区2024年数学三年级第一学期期末综合测试模拟试题含解析
- 山东省莱阳市赤山初级中学2024年六年级数学第一学期期末质量检测模拟试题含解析
- 扭王字块预制施工方案
- 护坦专项施工方案
- (整理版)九年级物理经典难题详解
- 订婚仪式流程主持词(精选3篇)
- VTE健康宣传手册
- 史上最全防水配方材料大全
- 第7章基于核熵成分分析的量子聚类算法PPT课件
- 大直径冲孔灌注桩极限承载力计算
- 弱电工程项目可行性研究报告
- 人教版四年级数学上册课课练
- 告警分析及其处理故障
评论
0/150
提交评论