DoorDash Lipotso tsa Puisano

Lipotso tsa DoorDash Array

Potso ea 1. Sebaka sa Max Island Tlhaloso ea Bothata: Ha ho fanoa ka matrix a 2D, matrix e na le 0 feela (e emelang metsi) le 1 (e emelang mobu) joalo ka litlatsetso. Sehlekehleke se matrix se theoa ka ho hlopha lihlopha tsohle tse haufinyane tsa 1 tse hokahantsoeng ka 4 (ka mokhoa o otlolohileng le o otlolohileng). Fumana sebaka se phahameng sa sehlekehleke ka har'a matrix. Nka hore likarolo tsohle tse 'ne tsa ...

Bala haholoanyane

Potso ea 2. Palo ea Boraro-bo-bong e nang le Kakaretso e ka tlase ho Boleng bo Fuoeng Polelo ea Bothata Re fane ka lenane le nang le linomoro tsa N tse ngata. Lethathamong le fanoeng, bala palo ea mafahla a mararo ka chelete e ka tlase ho boleng bo fanoeng. Ho kenya mohlala a [] = {1, 2, 3, 4, 5, 6, 7, 8} Kakaretso = Liphetho tse 10 Tse ka bang teng tse tharo tse tharo ke tsena: ...

Bala haholoanyane

Potso ea 3. Fumana Triplet ka Lethathamo ka Kakaretso e Fuoeng Polelo ea Bothata Ha u fuoa mefuta e mengata ea linomoro, fumana motsoako oa likarolo tse tharo tsa lenane leo kakaretso ea lona e lekanang le boleng bo fanoeng X. Mona re tla hatisa motswako oa pele oo re o fumanang. Haeba ho se na kopano e joalo, hatisa -1. Ho kenya mohlala N = 5, X = 15 arr [] = ...

Bala haholoanyane

Lipotso tsa Kerafo ea DoorDash

Potso ea 4. Sebaka sa Max Island Tlhaloso ea Bothata: Ha ho fanoa ka matrix a 2D, matrix e na le 0 feela (e emelang metsi) le 1 (e emelang mobu) joalo ka litlatsetso. Sehlekehleke se matrix se theoa ka ho hlopha lihlopha tsohle tse haufinyane tsa 1 tse hokahantsoeng ka 4 (ka mokhoa o otlolohileng le o otlolohileng). Fumana sebaka se phahameng sa sehlekehleke ka har'a matrix. Nka hore likarolo tsohle tse 'ne tsa ...

Bala haholoanyane

Lipotso tsa DoorDash Matrix

Potso ea 5. Sebaka sa Max Island Tlhaloso ea Bothata: Ha ho fanoa ka matrix a 2D, matrix e na le 0 feela (e emelang metsi) le 1 (e emelang mobu) joalo ka litlatsetso. Sehlekehleke se matrix se theoa ka ho hlopha lihlopha tsohle tse haufinyane tsa 1 tse hokahantsoeng ka 4 (ka mokhoa o otlolohileng le o otlolohileng). Fumana sebaka se phahameng sa sehlekehleke ka har'a matrix. Nka hore likarolo tsohle tse 'ne tsa ...

Bala haholoanyane

DoorDash Lipotso tse ling

Potso ea 6. Diagonal Traversal LeetCode Tharollo Polelo ea Bothata Tharollo ea Diagonal Traversal LeetCode - Ka lebaka la palo e felletseng ea 2D, khutlisetsa likarolo tsohle tsa lipalo ka tatellano ea diagonal joalo ka ha ho bonts'itsoe litšoantšong tse ka tlase. Kenyelletso: linomoro = [[1,2,3],[4,5,6],[7,8,9]] Sephetho: [1,4,2,7,5,3,8,6,9] Tlhaloso ea Diagonal Traversal LeetCode Solution Key Idea Mola oa pele le kholomo ea ho qetela bothateng bona e tla thusa ...

Bala haholoanyane

Potso ea 7. Sekaseka Webosaete ea Basebelisi Etela Mohlala LeetCode Tharollo Polelo ea Bothata Sekaseka Webosaete ea Mosebelisi Etela Mohlala oa LeetCode Tharollo - U fuoa mefuta e 'meli ea li-username le sebaka sa marang-rang le setempe sa linako tse felletseng. Litlhophiso tsohle tse fanoeng li bolelele bo lekanang 'me tuple [lebitso la mosebelisi[i], sebaka sa marang-rang[i], timestamp[i]] e bonts'a hore lebitso la mosebelisi[i] etetse sebaka sa marang-rang[i] ka timestamp[i]. Paterone ke lethathamo la liwebsaete tse tharo (eseng hore li fapane). Ka mohlala, ["lehae", ...

Bala haholoanyane

Potso ea 8. Moralo oa Nalane ea Sebatli Tharollo ea LeetCode Tlhaloso ea Bothata Histori ea Sebatli Tharollo ea LeetCode - U na le sebatli se nang le tabo e le 'ngoe moo u qalang leqepheng la lehae' me u ka etela url e 'ngoe, khutlela ho palo ea histori ea mehato kapa u tsoele pele historing ea palo ea mehato. Kenya tshebetsong sehlopha sa BrowserHistory: BrowserHistory(leqephe la lapeng la khoele) E qala ntho ka leqephe la lehae la ...

Bala haholoanyane

Potso ea 9. Lekola Reverse Polish Notation LeetCode Tharollo Phatlalatso ea Bothata Lekola Reverse Polish Notation LeetCode Tharollo - Lekola boleng ba polelo ea lipalo ho Reverse Polish Notation. Basebelisi ba sebetsang ke +, -, *, le /. Operand ka 'ngoe e ka ba palo e felletseng kapa polelo e 'ngoe. Hlokomela hore karohano lipakeng tsa linomoro tse peli e tlameha ho fokotseha ho ea ho zero. E netefalitsoe hore e fanoeng ...

Bala haholoanyane

Potso ea 10. Rectangle e Khōlō ka ho Fetisisa ho Histogram LeetCode Tharollo Polelo ea Bothata Rectangle e Khōlō ka ho Fetisisa ho Histogram LeetCode Tharollo – Ha ho fanoe ka palo e fapaneng ea bophahamo ba litopo tse emelang bophahamo ba bar ea histogram moo bophara ba bar e 'ngoe le e 'ngoe e leng 1, khutlisetsa sebaka sa khutlonnetsepa e kholo ka ho fetisisa ho histogram. Mohlala oa Tlhahlobo ea 1: Kenyelletso: bophahamo = [2, 1, 5, 6, 2, 3] Sephetho: 10 Tlhaloso: ...

Bala haholoanyane

Potso ea 11. Binary Tree Right Side View LeetCode Tharollo Polelo ea Bothata Binary Tree Right Side View LeetCode Tharollo - Ho fanoe ka motso oa sefate sa binary, ipone u eme ka lehlakoreng le letona la eona, 'me u khutlisetse litekanyetso tsa li-node tseo u ka li bonang li laetsoe ho tloha holimo ho ea tlaase. Mohlala oa Tlhahlobo ea 1: Kenyo: motso = [1, 2, 3, null, 5, null, ...

Bala haholoanyane

Potso ea 12. Koko Eating Banana LeetCode Solution Polelo ea Bothata Koko Ho ja Banana LeetCode Solution – Koko o rata ho ja libanana. Ho na le liqubu tsa libanana, qubu ea ith e na le liqubu[i] libanana. Balebeli ba tsamaile 'me ba tla khutla ka mor'a lihora tsa h. Koko a ka etsa qeto ea libanana tsa hae-ka hora lebelo la ho ja la k. Hora e 'ngoe le e 'ngoe, o khetha qubu ea libanana ebe o ja k banana qubung eo. Haeba ...

Bala haholoanyane

Potso ea 13. Fumana Median ho tsoa ho Data Stream LeetCode Solution Phatlalatso ea Bothata Fumana Median ho tswa ho Data Stream LeetCode Tharollo - Bohareng ke boleng ba bohareng ba lenane la palo e hlophisitsoeng. Haeba boholo ba lenane bo lekana, ha ho na boleng bo bohareng 'me bohareng ke moelelo oa litekanyetso tse peli tse bohareng. Mohlala, bakeng sa arr = [2,3,4], median ...

Bala haholoanyane

Potso ea 14. Asteroid Collision LeetCode Tharollo Problem Statement Asteroid Collision LeetCode Solution - Re fuoa sehlopha sa linaleli sa linaleli tse emelang li-asteroid ka tatellano. Bakeng sa asteroid ka 'ngoe, boleng bo feletseng bo emela boholo ba eona, 'me letšoao le emela tataiso ea eona (moelelo o nepahetseng o nepahetseng, moelelo o fosahetseng o setseng). Asteroid ka 'ngoe e tsamaea ka lebelo le tšoanang. Fumana naha...

Bala haholoanyane

Potso ea 15. Diagonal Traverse LeetCode Tharollo Polelo ea Bothata Diagonal Traverse LeetCode Tharollo - Ho fanoe ka mxn matrix mat, khutlisetsa letoto la likarolo tsohle tsa sehlopha ka tatellano ea diagonal. Kenyelletso: mat = [[1,2,3],[4,5,6],[7,8,9]] Sephetho: [1,2,4,7,5,3,6,8,9] Tlhaloso Nahana ka li-indices tsa diagonal tsa matrix a NxM. Ha re sebeliseng matrix a 4x4 joalo ka mohlala: ...

Bala haholoanyane

Potso ea 16. Tsela e telele ka ho Fetisisa ea Keketseho ka Tharollo ea LeetCode ea Matrix Polelo ea Bothata Tsela e Eketsehileng ka ho Fetisisa ka Tharollo ea LeetCode ea Matrix - Ho fanoe ka mxn integers matrix, khutlisetsa bolelele ba tsela e telele ka ho fetisisa e ntseng e eketseha ka matrix. Ho tloha seleng e 'ngoe le e' ngoe, u ka tsamaea ka litsela tse 'nè: ho le letšehali, ho le letona, holimo, kapa tlase. O kanna oa se ke oa tsamaea ka nqa e le 'ngoe kapa oa tsamaea ka ntle ho moeli (ke hore, ho pota-pota ha ho lumelloe). Kenyelletso:...

Bala haholoanyane

Potso ea 17. Kopanya le Deserialize Binary Tree LeetCode Tharollo Problem Statement Serialize and Deserialize Binary Tree LeetCode Solution - Serialization ke ts'ebetso ea ho fetolela sebopeho sa data kapa ntho hore e be tatellano ea likotoana e le hore e ka bolokoa faeleng kapa buffer ea memori, kapa e fetisetsoe ka har'a sehokelo sa khokahano ea marang-rang se tla tsosolosoa hamorao. ka...

Bala haholoanyane

Potso ea 18. Binary Tree Maximum Path Sum LeetCode Tharollo Polelo ea Bothata Binary Tree Maximum Path Sum LeetCode Solution - Tsela e sefateng sa binary ke tatellano ea li-node moo para e 'ngoe le e 'ngoe ea li-node tse haufi ka tatellano e nang le moeli o li kopanyang. Node e ka hlaha feela ka tatellano hang. Hlokomela hore tsela ha e hloke ...

Bala haholoanyane

Potso ea 19. Bonyane Knight e Tsamaisa LeetCode Tharollo Polelo ea Bothata Bonyane Knight e Tsamaisa LeetCode Tharollo - Ka har'a chessboard e sa feleng e nang le likhokahano ho tloha ho -infinity ho isa +infinity, u na le knight sekwere [0, 0]. Knight e na le metsamao e 8 eo e ka e etsang, joalo ka ha ho bontšitsoe ka tlase. Mohato o mong le o mong o na le lisekoere tse peli ka lehlakoreng la cardinal, ebe sekwere se le seng ka tsela ea orthogonal. Khutlisetsa bonyane ba nomoro ...

Bala haholoanyane

Potso ea 20. Tharollo ea LeetCode ea Nako ea mahala ea Basebetsi Polelo ea Bothata Tharollo ea Nako ea Mahala ea Basebetsi LeetCode - Re fuoa lethathamo la lenane la basebetsi, le emelang nako ea ho sebetsa bakeng sa mosebeletsi e mong le e mong. Mosebeletsi e mong le e mong o na le lethathamo la Linako tse sa amaneng, 'me linako tsena li hlophisoa. Khutlisetsa lenane la linako tse lekanyelitsoeng tse emelang nako ea mahala e tloaelehileng, ea bolelele bo nepahetseng bakeng sa basebetsi bohle, le ...

Bala haholoanyane

Potso ea 21. Jump Game Leetcode Tharollo Tlhaloso ea Bothata Papali ea Leetcode Tharollo - U fuoa palo e felletseng ea palo. Qalong u behiloe lethathamong la pele la sehlopha, 'me ntho e' ngoe le e 'ngoe e hlophisitsoeng e emela bolelele ba hao ba ho qhomela boemong boo. Khutlisetsa 'nete haeba u ka fihlela index ea ho qetela, kapa ho seng joalo e fosahetseng. Mohlala: Kenyeletso 1: linomoro = [2, ...

Bala haholoanyane

Potso ea 22. Latelang Greater Element III LeetCode Tharollo Polelo ea Bothata Bothata, Next Greater Element III LeetCode Solution e bolela hore o fuoa palo e kholo ea n 'me o hloka ho fumana palo e kholo e latelang o sebelisa linomoro tse teng ho n feela. Haeba ho se na palo e joalo, u lokela ho hatisa -1. Ho feta moo, e ncha ...

Bala haholoanyane

Potso ea 23. Palo ea Liprofinse Tharollo ea Leetcode Polelo ea Bothata Palo ea Liprofinse Leetcode Tharollo - Re fuoa boemeli ba matrix a adjacency ea graph mme re hloka ho fumana palo ea liprofinse. Mona profinse ke sehlopha sa litoropo tse hokahaneng ka kotloloho kapa ka tsela e sa tobang 'me ha ho litoropo tse ling kantle ho sehlopha. Mohlala oa 1: Kenyeletso: isConnected ...

Bala haholoanyane

Potso ea 24. Tharollo ea Sudoku Bothateng ba tharollo ea sudoku re fane ka sudoku e tlatsitsoeng ka mokhoa o sa fellang (9 x 9), ngola lenaneo ho phethela selotho. Sudoku e tlameha ho khotsofatsa thepa e latelang, Nomoro e ngoe le e ngoe (1-9) e tlameha ho hlaha hang hang ka tatellano mme hang ka kholomong. Nomoro e 'ngoe le e' ngoe (1-9) e tlameha ho hlaha hang hang ho ...

Bala haholoanyane

Translate »