### Implement the Two Sum problem using both brute force (O(n²)) and an optimized HashMap-based approach (O(n)).
Implement the Two Sum problem using both brute force (O(n²)) and an optimized HashMap-based approach (O(n)).