feat: trapping rain water problem done

This commit is contained in:
dqnid committed 2025-11-23 23:54:34 +01:00
1 parent feb122711a
commit 6a86e0ab9d
3 files changed
+78

No files matched your search

+14
View File
@@ -25,3 +25,17 @@ def test_find_missing():
result = find_missing(input)
expected = 4
assert result == expected
def test_rain_watter():
input = [3,0,1,0,4,0,2]
expected = 10
result = trap_rain_water(input)
assert result == expected
input = [3,0,2,0,4]
expected = 7
result = trap_rain_water(input)
assert result == expected
input = [1,2,3,4]
expected = 0
result = trap_rain_water(input)
assert result == expected