Task: In your workspace there is a partially broken implementation at /app/starter_code.py. The agent must fix the bugs and complete the implementation to provide a working function that sums multiples of 3 or 5 below n.
Deliverables
Create a Python file named multiples_of_3_or_5.py at the project root.
Implement a function with the signature:
def multiples_of_3_or_5_func(n: int) -> int
that returns the sum of all integers x such that 0 <= x < n and (x % 3 == 0 or x % 5 == 0).
Requirements
Input handling:
If n <= 0, the function returns 0.
n is expected to be an integer; raise a TypeError if a non-integer is provided.
Computation:
Sum all numbers less than n that are multiples of 3 or 5.
No double counting of numbers that are multiples of both (e.g., 15); count each such number once.
Implement using either an efficient arithmetic-series approach or a straightforward loop. The solution must be correct and performant for typical use.
Correctness verification:
For the given test table, the function should produce:
4 -> 3
10 -> 23
13 -> 45
0 -> 0
3 -> 0
6 -> 8
Documentation and type hints:
Include a clear docstring describing behavior, parameters, and return value.
Use type hints as shown in the signature.
Robustness:
The function should be side-effect free and independent of global state.
Notes
The behavior aligns with the common “sum of multiples of 3 or 5 below n” kata.
The tests will import multiples_of_3_or_5_func from the multiples_of_3_or_5 module and compare to the expected results.