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

Sebopeho sa Pele se Ikhethang ho Tharollo ea LeetCode ea String

Polelo ea Bothata Sebopeho sa Pele se Ikhethileng ka Tharollo ea LeetCode ea String - Ho fanoe ka khoele s, fumana sebopeho sa pele se sa phete-phetoang ho sona 'me u khutlisetse index ea sona. Haeba e le sieo, khutlisetsa -1. Mohlala oa Tlhahlobo ea 1: Kenyelletso: s = “leetcode” Sephetho: 0 Taba ea Teko ea 2: Kenyeletso: s = “aabb” Sephetho: -1 Tlhaloso ...

Bala haholoanyane

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

Phetoho ea Chelete ea 2 Tharollo ea Leetcode

Polelo ea Bothata Phetoho ea Chelete ea Lichelete 2 Tharollo ea LeetCode - "Chelete ea Chelete ea 2" e bolela hore ho fanoe ka mefuta e mengata ea lichelete tsa tšepe tse fapaneng le palo e feletseng, e emelang chelete eohle. Re hloka ho khutlisa palo ea palo ea kakaretso ea metsoako e fapaneng e ka bang teng ho palo eo. …

Bala haholoanyane

Tsamaisa Zeroes LeetCode Tharollo

Problem Statement Bothata, Move Zeroes LeetCode Solution e bolela hore o filwe lethathamo le nang le lefela le dielemente tse senang lefela mme o hloka ho tsamaisa zero qetellong ya letoto, o boloke tatellano e lekanyeditsweng ya dikarolo tseo e seng zero ka palo. . U boetse u hloka ho kenya ts'ebetsong sebakeng se itseng ...

Bala haholoanyane

Tharollo ea Leetcode ea Nomoro e le 'Ngoe

Polelo ea Bothata Tharollo ea Nomoro e le 'Ngoe ea Leetcode - Re fuoa lethathamo le se nang letho la linomoro 'me re hloka ho fumana ntho e hlahang hang feela. Ho fanoe ka potso ea hore element e 'ngoe le e 'ngoe e hlaha habeli ntle le e le' ngoe. Mohlala 1: Kenyeletso: lipalo = [2,2,1] Sephetho: 1 Mohlala 2: Kenyelletso: ...

Bala haholoanyane

Subarray e nang le kakaretso ea 0

Bothata "Fumana hore na ho na le subarray e nang le 0 sum" e re o filoe lenane le felletseng le nang le linomoro tse fosahetseng hape. Polelo ea bothata e botsa ho fumana hore na ho na le mofuta ofe kapa ofe oa boholo bo bonyane bonyane 1. Sehlopha sena se ka tlase se lokela ho ba le kakaretso e lekanang le 1. Mohlala arr [] = {2,1, -3,4,5}…

Bala haholoanyane

Translate »