Isisombululo seJavaScript sokuBambisa amanzi emvula

Ibhlog

Isisombululo seJavaScript sokuBambisa amanzi emvula

Kudliwanondlebe lwam lokugqibela lobuchwephesha, ndacelwa malunga nendlela yokubambisa amanzi emvula. (Hayi ngenene 🤪). Kwakunzima kakhulu Ikhowudi yemayile ingxaki. Ndikufumene kunzima, yiyo loo nto ndingathanda ukubhala ibhlog malunga nayo. Ukuqinisekisa ukuba ndiyayiqonda indlela yokusombulula iingxaki ezifanayo kwixa elizayo.



uluhlu lwamakhadi endalo

Ingxaki:

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.

Umfanekiso weposi

Imephu yokuphakama ngasentla imelwe luluhlu [0,1,0,2,1,0,1,3,2,1,2,1]. Kule meko, iiyunithi ezi-6 zamanzi emvula (icandelo eliluhlaza) zibanjiwe.



Example: Input: [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6

#raindrop #leetcode #javascript # ukubambisa-amanzi emvula #programming

ephakathi.com

Isisombululo seJavaScript sokuBambisa amanzi emvula

Kudliwanondlebe lwam lokugqibela lobuchwephesha, ndacelwa malunga nendlela yokubambisa amanzi emvula. (Hayi ngenene 🤪). Yayiyingxaki yenqanaba leLeetcode. Ndikufumene kunzima, yiyo loo nto ndingathanda ukubhala ibhlog malunga nayo. Ukuqinisekisa ukuba ndiyayiqonda indlela yokusombulula iingxaki ezifanayo kwixa elizayo.