Google interview question

Two Sum, Number of connected components, etc.