下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、 亞馬遜 2022 技術(shù)崗面試題第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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 機電設(shè)備維修和保養(yǎng)
- 2024年12月4日chinadaily時政類語篇型填空專項訓練(學生們在詩歌中找到創(chuàng)造性的出路)-2025屆高三英語一輪復(fù)習
- (2024年秋季版)七年級道德與法治下冊 第四單元 體悟生命價值 第11課 自尊自信 第1框 做人當自尊教學思路 蘇教版
- 九年級歷史下冊 第一單元 殖民地人民的反抗與資本主義制度的擴展 第4課 日本明治維新教學實錄4 新人教版
- 2021秋季運動會學生作文十篇
- 2022年初三《平凡的世界》讀后感5篇范例
- 大學新生軍訓心得體會(合集15篇)
- 翠鳥教案模板七篇
- 當幸福來敲門電影觀后感范文6篇
- 駱駝祥子讀書筆記一至二十四章
- 年終抖音運營述職報告
- 期末教師會議德育副校長講話:德育需要奉獻
- 腦梗死患者的護理常規(guī)
- 2024年7月國家開放大學法律事務(wù)??啤斗勺稍兣c調(diào)解》期末紙質(zhì)考試試題及答案
- 大學生科學運動與控制體重(黑龍江幼兒師范高等??茖W校)知到智慧樹答案
- 2023年4月1日江蘇省事業(yè)單位統(tǒng)考《綜合知識和能力素質(zhì)》(管理崗客觀題)原卷+答案
- 診斷復(fù)習測試卷含答案
- 【MOOC】電工學-西北工業(yè)大學 中國大學慕課MOOC答案
- 護士條例解讀
- 檢修工(題庫)附答案
- 2025屆高考語文一輪復(fù)習:小說情節(jié)結(jié)構(gòu)之伏筆 練習題(含答案)
評論
0/150
提交評論