feat: trapping rain water problem done

This commit is contained in:
2025-11-23 23:54:34 +01:00
parent feb122711a
commit 6a86e0ab9d
3 changed files with 78 additions and 0 deletions

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