Solve the Number of Islands problem and provide a follow-up solution for handling additional features like lakes.