文件名称:矩形序列在matlab中代码-leetcode-notes:leetcode-notes
文件大小:7KB
文件格式:ZIP
更新时间:2024-06-22 01:26:32
系统开源
matlab中代码leetcode-notes 42. 收集雨水 左指针 aur 右指针 lo, paani toh un logo ke bich me hi bharega, toh minimum kaunsa hai woh paani woh building ke upper aayega。 public int trap( int [] A ){ int a = 0 ; int b = A . length - 1 ; int max = 0 ; int leftmax = 0 ; int rightmax = 0 ; while (a <= b){ leftmax = Math . max(leftmax, A [a]); rightmax = Math . max(rightmax, A [b]); if (leftmax < rightmax){ max += (leftmax - A [a]); // leftmax is smaller than rightmax, so the (leftmax-A[a]) water can be stored a ++ ;
【文件预览】:
leetcode-notes-main
----hello.py(605B)
----form-filler.js(28B)
----README.md(7KB)
----.project(666B)
----.vscode()
--------.ropeproject()
--------launch.json(463B)