Practicing algorithmic thinking in C++ — solved Two Sum in both O(n²) and O(n), explained complement logic, hash tables, and return patterns. Clear code, clean complexity. • Solve it first in O(n²) (the brute force way) • Improve it to O(n) using (hash table) • Show how the final answer is “previous index + current index” We are given: We must return indices of two numbers in whose sum equals . There is exactly one solution and we cannot use the same element twice.