Tharollo ea Leetcode ea Metsi a ho Tlisa Pula

Polelo ea Bothata The Trapping Rain Water LeetCode Solution - "Trapping Rain Water" e bolela hore ho fanoe ka lethathamo la libaka tse phahameng tse emelang 'mapa oa bophahamo moo bophara ba bar e' ngoe le e 'ngoe e leng 1. Re hloka ho fumana palo ea metsi a qabeletsoeng ka mor'a pula. Mohlala: Kenyo: bophahamo = [0,1,0,2,1,0,1,3,2,1,2,1] Sephetho: 6 Tlhaloso: Sheba ...

Bala haholoanyane

Masakaneng a Sebetsang Tharollo ea Leetcode

Polelo ea Bothata Tharollo ea LeetCode e Sebetsang - "Masakaneng a Tšepahalang" e re o fuoa khoele e nang le litlhaku feela '(', ')', '{', '}', '[' le ']'. Re hloka ho fumana hore na khoele ea ho kenya ke khoele e nepahetseng kapa che. Khoele ho thoe ke khoele e sebetsang haeba masakaneng a bulehileng a tlameha ho koaloa ...

Bala haholoanyane

Sehlahisoa sa Array Ntle le Tharollo ea Self LeetCode

Sehlahisoa sa Bothata Sehlahisoa sa Array Ntle le Tharollo ea Self LeetCode - Ho fanoe ka palo e feletseng ea palo, khutlisetsa karabo e fapaneng hoo karabo[i] e lekanang le sehlahisoa sa likarolo tsohle tsa lipalo ntle le linomoro[i]. Sehlahiswa sa sehlongwapele sefe kapa sefe kapa sehlotshwana sa dinomoro se netefaditswe ho lekana palo e feletseng ya 32-bit. U tlameha ho ngola algorithm e tsamaeang ka nako ea O(n) ntle le ho sebelisa karohano ...

Bala haholoanyane

String to Integer (atoi) LeetCode Tharollo

Polelo ea Bothata The String to Integer (atoi) Leetcode Solution -"String to Integer (atoi)" e bolela hore Ho kenya ts'ebetsong myAtoi(string s), e fetolang khoele ho palo e saenneng ea 32-bit (e ts'oanang le ts'ebetso ea atoi ea C/C ++ ). Algorithm bakeng sa myAtoi(string s) e tjena: Bala 'me u hlokomolohe sebaka sefe kapa sefe se etellang pele se tšoeu. Sheba hore na sebapali se latelang (haeba ...

Bala haholoanyane

Tharollo ea Leetcode ea Nomoro e sieo

Phatlalatso ea Bothata Tharollo ea Nomoro e Fokohileng ea LeetCode - "Nomoro e sieo" e bolela hore ho fanoe ka palo ea boholo ba n e nang le linomoro tse fapaneng pakeng tsa [0,n]. Re hloka ho khutlisa nomoro e sieo sebakeng sa marang-rang. Mohlala: Kenyeletso: lipalo = [3,0,1] Sephetho: 2 Tlhaloso: Re ka hlokomela ha bonolo hore tsohle ...

Bala haholoanyane

Tharollo ea Isomorphic Strings Leetcode

Polelo ea Bothata bothateng bona, re fuoa likhoele tse peli, a le b. Morero oa rona ke ho tseba hore na likhoele tse peli ke isomorphic kapa che. Likhoele tse peli li bitsoa isomorphic haeba feela ha litlhaku tse khoeleng ea pele li ka nkeloa sebaka ke sebapali sefe kapa sefe (ho kenyeletsoa le sona) ho hang…

Bala haholoanyane

Tharollo ea Lethathamo la Leetcode la Palindrome

Bothateng ba "Palindrome Linked List", re tlameha ho lekola hore na lenane le fuoeng la bong bo le bong bo hokahaneng ke palindrome kapa che. Lethathamo la Mehlala = {1 -> 2 -> 3 -> 2 -> 1} Tlhaloso ea 'nete # 1: Lenane lena le palindrome joalo ka ha likarolo tsohle ho tloha qalong le morao li le…

Bala haholoanyane

Fetolela BST e tloaelehileng ho BST e leka-lekaneng

Polelo ea Bothata e fuoe Sefate sa Patlo ea Binary (BST), ngola algorithm ho fetolela BST ho Sefate se Ts'oanang sa Binary Search. Sefate se leka-lekaneng sa Binary Search ha se letho haese sefate sa patlo ea binary seo phapang ea sona lipakeng tsa bophahamo ba subtree ea leqele le letsohong le letona e ka tlase ho kapa e lekana le 1.

Bala haholoanyane

Hlahloba boholo ba boholo ba n bo ka emela BST ea maemo kapa ha

Polelo ea Bothata Ha u fuoa sehlopha se nang le likarolo, hlahloba boholo ba boholo ba n bo ka emela BST ea maemo kapa ha. Seo ke ho hlahloba hore na sefate sa patlo sa binary se hahiloeng ho sebelisoa li-element tsa n se ka emela BST ea maemo. Mehlala arr [] = {10, 8, 6, 9,…

Bala haholoanyane

Translate »