Capital One Mafunso Pofunsa

Mafunso oyankhulana ndi kamangidwe ka dongosolo akhoza kukhala omasuka kwambiri, kuti ndizovuta kwambiri kudziwa njira yoyenera yokonzekera. Tsopano ndikutha kusokoneza mapangidwe a Amazon, Microsoft, ndi Adobe ndikagula bukhu ili. Kubwereza tsiku ndi tsiku funso lopanga ndipo ndikulonjeza kuti mutha kusokoneza dongosolo lozungulira.

Zokambirana za Crack System Design

Mafunso a Capital One Array

Funso 1. Kuphatikiza Njira Yina Ya Leetcode Vuto pamavuto "Kuphatikizanso Mmodzi" timapatsidwa mndandanda womwe uliwonse wamaguluwo umaimira manambala. Gulu lathunthu likuyimira nambala. Zeroth index imayimira MSB ya nambala. Titha kuganiza kuti palibe zero yotsogolera mu ...

Werengani zambiri

Funso 2. Werengani zonse zomwe zakhala ndi zotsika zosakwana K Vuto "Werengani zonse zomwe zakhala ndi malonda ochepera K" akuti mupatsidwa manambala angapo. Tsopano pezani kuchuluka kwa zotsatira zomwe zili ndi malonda ochepera zomwe zapatsidwa K. Chitsanzo a [] = {1, 2, 3, 4, 5} k = 8 Chiwerengero chotsatira zochepa ...

Werengani zambiri

Funso 3. Pezani chilichonse mwazinthu zobwereza mobwerezabwereza mumndandanda wokha vuto loti "Pezani chilichonse mwazinthu zobwereza zomwe zili mumndandanda wowerengera" chimati ngati mutapatsidwa kukula kwa kuwerenga (n + 1). Mndandanda uli ndi manambala kuyambira 1 mpaka n. Ntchito yanu ndikupeza chilichonse mwazinthu zobwereza mu ...

Werengani zambiri

Funso 4. Mafunso a GCD a manambala onse amitundu kupatula zinthu zosiyanasiyana Ndemanga Yovuta Vuto la "Queries for GCD of all numbers of a array except elements in a range range" limanena kuti mupatsidwa mafunso angapo. Funso lililonse lili ndi nambala kumanzere ndi kumanja. Nkhani yamavuto ikufunsa kuti mupeze ...

Werengani zambiri

Funso 5. Top K pafupipafupi Zinthu Chidziwitso Chavuto Pamwamba pa K zinthu zomwe tapereka pafupipafupi [], pezani zopezeka k zomwe zimachitika pafupipafupi. Zitsanzo nums[] = {1, 1, 1, 2, 2, 3} k = 2 1 2 nums[] = {1} k = 1 1 Njira Yopanda Nave ya Ma Elements Apamwamba K Omwe Amamangidwa pafupipafupi ...

Werengani zambiri

Funso 6. Njira zitatu zogawa magawo osiyanasiyana osiyanasiyana Chiwerengero Chavuto Mumapatsidwa ma nambala angapo komanso otsikaValue ndi highValue. Vuto "Njira zitatu zogawa magawo osiyanasiyana osiyanasiyana" limafunsa kugawa gulu lomwe gulu logawa magawo atatu. Magawo azigawo azikhala: Zinthu ...

Werengani zambiri

Funso 7. Pezani zotsatira zakukula kwa 3 munthawi yofanana Ndemanga Yovuta Vuto "Pezani zotsatira zosankhidwa kukula kwa 3 munthawi yofanana" akuti muli ndi gulu lonse. Nkhani yamavuto ikufunsa kuti mupeze manambala atatuwo mwanjira yoti [i] <array [k] <array [k], ndi i <j <k. Mwachitsanzo arr [] ...

Werengani zambiri

Funso 8. Chiwerengero cha zinthu zochepa ndi zazing'ono zazing'ono zonse za k Ndemanga Ya Vuto Vuto "Zazikuluzikulu zazing'ono zazing'ono zonse zazing'ono za k" limanena kuti mwapatsidwa mndandanda wokhala ndi ziwerengero zabwino ndi zoyipa, pezani kuchuluka kwa zinthu zochepa komanso zazing'ono zazing'ono zonse za k. Zitsanzo arr [] = {5, 9, 8, 3, ...

Werengani zambiri

Funso 9. Sungani zinthu zonse zoyipa kuti zitheke ndikakhala ndi malo owonjezera ololedwa Chiwerengero cha Vuto "Sinthani zinthu zonse zoipa kuti zitheke mwa dongosolo ndi malo owonjezera ololedwa" akuti mwapatsidwa gulu lokhala ndi manambala abwino komanso oyipa onse Nkhani yamavuto ikufunsa kuti tisunthire zoyipa zonse zomaliza. Chitsanzo arr [] = {1,2, -3, -5,2,7, -9, -11} 1, ...

Werengani zambiri

Funso 10. Pezani ma subarray osachepera Chiwerengero Chavuto Mwapereka magulu angapo komanso nambala k. Ndemanga yamavuto ikufunsa kuti apeze zojambulazo ndizochepa, zomwe ndi kupeza zigawo zingapo za k, zomwe zili ndi average yochepa. Chitsanzo arr [] = {12, 34, 20, 30, 24, 45} k = 3 Sub-Array of [0, 2] ali ndi average yochepa. Kufotokozera: ...

Werengani zambiri

Funso 11. Kuchepa kwama subsets okhala ndi zinthu zosiyana Chiwerengero cha Vuto Tiyerekeze kuti muli ndi nambala zingapo zazikulu kukula n. Nkhani yamavuto ikufunsa kuti mupeze nambala yocheperako yama subsets okhala ndi zinthu zosiyana, ndiwo ma subsets omwe amatha kupangidwa omwe ali ndi zinthu zosiyanasiyana zosiyana kuchokera pagulu lomwelo. Chitsanzo arr [] = {2,4,6,2,1,4,2} 3 Kufotokozera: {1, ...

Werengani zambiri

Funso 12. Werengani masitepe ochepa kuti mupeze zomwe mukufuna Statement Yovuta Tiyerekeze kuti muli ndi gulu lokhala ndi nambala 0 yokha monga zinthu zake zonse. Ganizirani, mumapatsidwa kutalika kwa kutalika n kukhala ndi ma 0 onse momwe timasinthira ma 0 kukhala gulu lomwe likufunika. Titha kutchula mndandanda womwe ungafunikeArr ...

Werengani zambiri

Funso 13. Nambala Yosowa Pakusowa kwa Nambala tapatsa kukula kwa N komwe kuli nambala kuyambira 0 mpaka N. Miyezo yonse pamndandanda ndiyapadera. Tiyenera kupeza nambala yomwe ikusowa yomwe sikupezeka pagulu ndipo nambala imeneyo ili pakati pa 0 mpaka N. Apa ...

Werengani zambiri

Funso 14. Vuto Losintha Ndalama Vuto Losintha Ndalama - Popeza tapatsidwa ndalama zamitundu yosiyanasiyana c1, c2,…, cs (Mwachitsanzo: 1,4,7….). Tikufuna ndalama n. Gwiritsani ntchito ndalamazi kuti mupange ndalamazo n. Mutha kugwiritsa ntchito ndalama kambiri momwe mungafunikire. Pezani njira zonse zomwe ...

Werengani zambiri

Funso 15. Konzaninso Manambala Abwino ndi Olakwika Kapenanso mu Array Statement Yovuta Pamavuto a "Yambitsaninso Nambala Zoyenera Ndi Zosayenerera Kapenanso Kuti Mukhale Mgulu" tapereka mndandanda wa []. Gulu ili lili ndi manambala abwino komanso osalimbikitsa. Yambitsaninso gulu m'njira yoti zabwino ndi zoyipa ziyikidwe mwanjira ina. Apa, kuchuluka kwa zinthu zabwino ndi zoyipa sikuyenera ...

Werengani zambiri

Funso 16. Pezani Zomwe Zatayika Kuchokera Pazowerengera Zowerengeka Statement Yovuta Popeza magulu awiri A ndi B, gulu limodzi limafanizidwa ndi linalo kupatula chinthu chimodzi. Chinthu chimodzi sichikupezeka pa A kapena B. tikufunika kuti tipeze chomwe chatayika kuchokera pagulu lofananira. Mwachitsanzo 5 1 6 4 8 9 6 4 8 ...

Werengani zambiri

Funso 17. Konzaninso Mpangidwe wopatsidwa mu Maximum Minimum Form Ndemanga Ya Vuto Muvuto la "Yambitsaninso Zida mu Fomu Yoyenera Yoyenera", tapereka mndandanda womwe uli ndi ma elementi a N. Konzaninso mndandanda wamanambala abwino opatsidwa, kuti zinthu zina zikhale zochepa ndi zochepa. Onani pansipa kuti mumvetsetse bwino za kukonzanso kwa zinthu- Array [0] ...

Werengani zambiri

Funso 18. Sungani Zero Zonse Kumapeto kwa Gulu Lopatsidwa Ndemanga Ya Vuto Mumagawo omwe apatsidwa amasuntha zero zonse zomwe zikupezeka mgulu mpaka kumapeto kwa gulu. Apa pali njira yomwe ilipo yoyikitsira zero zero zonse kumapeto kwa gulu. Mwachitsanzo Kulowetsa 9 9 17 0 14 0 ...

Werengani zambiri

Funso 19. Pezani Nambala Yochepera Kwambiri Pazosanja Zosanjidwa Chiwonetsero Chavuto Pavuto "Pezani Kochepera Kwambiri Kosoweka mu Mzere Wosanjikiza" tapereka mndandanda wathunthu. Pezani nambala yaying'ono kwambiri yomwe yasowa mu mtundu wa N wosanjikiza wokhala ndi zinthu zapadera kuyambira 0 mpaka M-1, pomwe M> N. Kuyika Chitsanzo [0, 1, 2, 3, 4, 6, 7, ...

Werengani zambiri

Funso 20. Pezani Nambala Yosowa Chiwerengero Chavuto Popeza nambala yomwe ikusowa kuchokera pagulu limodzi mpaka manambala a N tapereka mndandanda womwe uli ndi manambala a N-1. Nambala imodzi ikusowa pamitundu ingapo kuyambira 1 mpaka N. Tiyenera kupeza nambala yomwe ikusowapo. Mtundu Wolowetsera Mzere woyamba wokhala ndi nambala yonse ...

Werengani zambiri

Mafunso a Capital One String

Funso 21. License Ofunika Kupanga Leetcode Solution Chiwerengero Chavuto Pamavuto a "Licencing Key Format", kulowererako kumakhala ndi zilembo zingapo, zomwe zikuyimira kiyi wa layisensi. Poyamba, chingwecho chimagawika m'magulu a N + 1 (mawu) ndi N kudumphira pakati. Timaperekedwanso nambala K, ndipo cholinga chake ndikupanga chingwe ...

Werengani zambiri

Funso 22. Zotsatira Zakale Kwambiri Vuto loti "Kubwerezabwereza Kwambiri" likuti mwapatsidwa chingwe kuti mulowetse. Pezani zomwe zimachitika mobwerezabwereza, zomwezo ndizomwe zimapezeka kawiri mchingwe. Chitsanzo aeafbdfdg 3 (afd) Yandikirani Vutoli limatifunsa kuti tipeze njira yomwe yatchulidwapo motalika kwambiri mu chingwe. ...

Werengani zambiri

Funso 23. Kuphatikiza Kwamalembo Nambala Yafoni M'makalata osakanikirana ndi vuto la nambala yafoni, tapatsa chingwe chomwe chili ndi manambala kuyambira 2 mpaka 9. Vuto ndikupeza kuphatikiza komwe kungayimilidwe ndi nambala imeneyo ngati nambala iliyonse ili ndi makalata omwe apatsidwa. Nambala yoperekedwa ndi ...

Werengani zambiri

Funso 24. Text Justification LeetCode Solution Tikambirana za Text Justification LeetCode Solution lero Vuto la Vuto Vuto "Kulungamitsidwa Kwamawu" limanena kuti mwapatsidwa mndandanda s[ ] wa mtundu wa chingwe cha kukula n ndi kukula kwake. Tsimikizirani mawuwo kuti mzere uliwonse ukhale ndi kuchuluka kwa zilembo. Mutha ...

Werengani zambiri

Funso 25. Chitsanzo cha Mawu Tonse tidakumana ndimitundu yamawu monga "ABBA", "AABB" ndi zina zotero. Nthawi zonse timadabwa kuti kubwebwenzaku kukugwirizana chiyani. Lero tidzayesa kuthetsa vuto pomwe timayesa kugwiritsa ntchito kubble. Kuchuluka kwa zovuta zazingwe sikuthandiza pankhaniyi. Popeza ...

Werengani zambiri

Funso 26. Onani ngati mndandanda wa Strings wapanga Palindrome Ndemanga Ya Vuto Mu "Fufuzani ngati mndandanda wa Zingwe Zolumikizana upanga vuto la Palindrome" tapatsa mndandanda wolumikizana ndi zingwe. Lembani pulogalamu kuti muwone ngati zidziwitsozo zimapanga palindrom kapena ayi. Chitsanzo ba-> c-> d-> ca-> b 1 Kufotokozera: Pachitsanzo pamwambapa titha kuwona kuti ...

Werengani zambiri

Capital One Tree Mafunso

Funso 27. Sinthani BST yachibadwa kukhala Banced Balanced Chiwonetsero Chavuto Chinapatsidwa Mtengo Wosaka Binary (BST), lembani algorithm kuti musinthe BST kukhala Mtengo Wosaka wa Binary Search. Mtengo woyeserera wa Binary Search sichina koma mtengo wosakira wamabinawo yemwe kusiyana kwake pakati pa kutalika kwa subtree kumanzere ndi kumanja kumanja kumunsi kuli kochepera kapena kofanana ndi 1. ...

Werengani zambiri

Funso 28. Mtengo Wofanana Muvuto la Symmetric Tree tapereka mtengo wa binary, onani ngati ndi galasi lokha. Mtengo umanenedwa kuti ndi chifaniziro chagalasi chokha ngati pali axis of symmetry kudzera mu node ya mizu yomwe imagawaniza mtengowo m'magawo awiri ofanana. Mitundu ya Zitsanzo...

Werengani zambiri

Mafunso a Capital One Stack

Funso 29. Onjezani Nambala Awiri II Leetcode Solution Ndemanga Yavuto Onjezani Ma Nambala Awiri II LeetCode Solution - "Onjezani Nambala Ziwiri II" imanena kuti mindandanda iwiri yopanda kanthu yolumikizidwa imayimira magawo awiri osakhala olakwika pomwe nambala yofunika kwambiri imabwera koyamba ndipo node iliyonse imakhala ndi nambala imodzi ndendende. Tiyenera kuwonjezera manambala awiri ndikubweza ndalamazo ngati ...

Werengani zambiri

Funso 30. Anakonza Min Leackcode Statement Yovuta Pangani okwera omwe amathandizira kukankha, pop, pamwamba, ndikupeza zochepa pazanthawi zonse. Kankhani (x) - Kankhirani chinthu x pamtengo. pop () - Imachotsa chinthucho pamwamba pamatumba. top () - Pezani chinthu chapamwamba. getMin () - Pezani chinthu chochepa kwambiri muluwo. ...

Werengani zambiri

Funso 31. Min okwana Mu min stack stack tifunika kupanga okwanira kuti tigwiritse ntchito zotsatirazi moyenera, kankhani (x) -> Kankhirani chinthu x pakapepala kakang'ono () -> Chotsani chinthucho pamwamba pa stack top () -> Bweretsani chinthucho pamwamba pa stack getMin () -> Bweretsani zinthu zochepa zomwe zilipo ...

Werengani zambiri

Mafunso a Capital One Queue

Funso 32. Chiwerengero cha zinthu zochepa ndi zazing'ono zazing'ono zonse za k Ndemanga Ya Vuto Vuto "Zazikuluzikulu zazing'ono zazing'ono zonse zazing'ono za k" limanena kuti mwapatsidwa mndandanda wokhala ndi ziwerengero zabwino ndi zoyipa, pezani kuchuluka kwa zinthu zochepa komanso zazing'ono zazing'ono zonse za k. Zitsanzo arr [] = {5, 9, 8, 3, ...

Werengani zambiri

Capital One Mafunso Ena

Funso 33. LRU Cache Leetcode Solution Ndemanga Yavuto The LRU Cache LeetCode Solution - "LRU Cache" ikukupemphani kuti mupange dongosolo la data lomwe limatsatira Posachedwapa Posachedwapa (LRU) Cache Tiyenera kugwiritsa ntchito kalasi ya LRUCache yomwe ili ndi izi: LRUCache(int capacity): Imayambitsa kache ya LRU ndi kukula kwabwino. int get(int key): Bweretsani mtengo ...

Werengani zambiri

Funso 34. Mawu Pattern LeetCode Solution Vuto la Vuto la Mawu Chitsanzo LeetCode Solution - Timapatsidwa zingwe za 2 - "s" ndi "chitsanzo", tifunika kupeza ngati chitsanzocho chikutsatira s. Kutsatira apa kukutanthauza kufanana kwathunthu. Mwamwayi, titha patani iliyonse[i] payenera kukhala imodzi yokha s[i] ndipo mosinthanitsa ndi ...

Werengani zambiri

Funso 35. Chotsani Maulalo Othandizira Mndandanda wa Leetcode Solution Statement Yovuta Pamavuto awa, tapatsidwa mndandanda wolumikizidwa ndi ma node ake okhala ndi ziwerengero zonse. Tiyenera kuchotsa mfundo zina pamndandanda zomwe zili ndi mtengo wofanana ndi val. Vutoli silikufuna kuthetsedwa m'malo koma tikambirana njira imodzi. Mndandanda wazitsanzo = ...

Werengani zambiri

Funso 36. Palindrome Yolumikiza Mndandanda wa Leetcode Solution Muvuto "Palindrome Linked List", tiyenera kuwunika ngati mndandanda wathunthu wathunthu wolumikizidwa ndi palindrome kapena ayi. List List = {1 -> 2 -> 3 -> 2 -> 1} Kufotokozera koona # 1: Mndandandawu ndi palindrome popeza zinthu zonse kuyambira koyambirira ndi kumbuyo zili ...

Werengani zambiri

Funso 37. Gwirizanitsani Magulu Awiri Osiyanasiyana Leetcode Solutions Mndandanda wolumikizidwa uli ngati mndandanda wazinthu zawo. Titha kuphatikiza magulu awiri omwe asankhidwa kuti apange gulu lathunthu. Vutoli, tiyenera kuphatikiza mindandanda iwiri yolumikizidwa m'malo kuti tibwezeretse mndandanda watsopano womwe uli ndi mndandanda wazinthu zonsezo mwanjira zosankhidwa. Mwachitsanzo ...

Werengani zambiri

Funso 38. Awerengere Ma Primes Leetcode Solutions Vutoli, tapatsidwa nambala yochuluka, N. Cholinga ndikuwerengera momwe manambala ochepera N, ndi ma primes. Nambala yonse imakakamizidwa kuti isakhale yoyipa. Chitsanzo 7 3 10 4 Kufotokozera Maofesi ochepera 10 ndi 2, 3, 5 ndi 7. Chifukwa chake, kuchuluka kwake ndi 4. Njira (Brute ...

Werengani zambiri

Funso 39. Phatikizani Magulu Awiri Olumikizidwa Phatikizani mindandanda iwiri yolumikizidwa yomwe tapereka cholozera pamndandanda wazinthu ziwiri zolumikizidwa, ziphatikize kotero kuti mndandanda umodzi wolumikizidwa upezeka womwe uli ndi mfundo zomwe zili ndi mfundo zake mwadongosolo. bweretsani cholozera cham'mndandanda wophatikizidwa. Chidziwitso: phatikizani mndandanda wolumikizidwawo osagwiritsa ntchito ...

Werengani zambiri

Funso 40. Gwirizanitsani Ndandanda Yawiri Ya Leetcode Kodi kuphatikiza mindandanda iwiri yosankhidwa ndi vuto pa leetcode? Ili ndi funso losangalatsa lomwe amafunsidwa nthawi zambiri m'makomponi monga Amazon, Oracle, Microsoft, ndi zina zambiri.Mu vutoli (Merge Two Sorted Lists Leetcode), takupatsani mindandanda iwiri yolumikizidwa. Manambala onse awiriwa akuchulukirachulukira. Gwirizanitsani mndandanda womwe ulumikizidwe mu ...

Werengani zambiri

Funso 41. Kukhazikitsa kwa LRU Cache Cache Yosavuta Kugwiritsa Ntchito Posachedwa (LRU) ndi mtundu wa njira yomwe imagwiritsidwa ntchito kusungitsa zomwe zidafotokozedwazo kotero kuti nthawi yofunikira kugwiritsa ntchito tsambalo ndiyomwe ndiyotheka. LRU algorithm yomwe imagwiritsidwa ntchito cache ikadzaza. Timachotsa zosagwiritsidwa ntchito posachedwa posungira posungira za ...

Werengani zambiri

Funso 42. Sieve wa Eratosthenes Sieve of Eratosthenes ndi njira yolumikizira momwe timapezera manambala ochepera N. Pano N ndi mtengo wokwanira. Imeneyi ndi njira yabwino yodziwira manambala oyambira mpaka malire. Pogwiritsira ntchito izi titha kudziwa manambala oyamba mpaka 10000000. Apa ...

Werengani zambiri

Translate »