Sum of digits
Return the sum of all decimal digits of a non-negative integer.
Collatz steps
Count how many steps the Collatz sequence takes to reach 1 from n.
Factorial (iterative)
Compute n! iteratively without recursion.
Prime checker
Return True if n is a prime number.
Stack class
Implement a Stack class with push, pop, peek, is_empty, and size.
Linked list reversal
Implement a singly linked list and a function to reverse it in place.
Matrix addition operator
Implement a Matrix class that supports + and * operators.
2D Vector dataclass
Implement a Vector2D dataclass with +, -, scalar *, dot product, and magnitude.
Data pipeline
Implement a Pipeline class supporting pipe chaining with the | operator.
Validated descriptor
Implement a TypedField descriptor that raises TypeError if the value is not of the expected type.
Showing 10 challenges