feat: more statistics + a simple exercise

This commit is contained in:
2025-11-23 17:10:25 +01:00
parent 86e86ea567
commit a26970f873
4 changed files with 71 additions and 3 deletions

19
tests/test_essentials.py Normal file
View File

@@ -0,0 +1,19 @@
import pytest
from src.modules.exercises.essentials import *
def test_subarray_sum():
input = [2,3,-8,7,-1,2,3]
result = maximum_subarray_sum(input)
expected = [11, [7, -1, 2, 3]]
assert result == expected
input = [-2,-4]
result = maximum_subarray_sum(input)
expected = [-2, [-2]]
assert result == expected
input = [5,4,1,7,8]
result = maximum_subarray_sum(input)
expected = [25, [5,4,1,7,8]]
assert result == expected