Cisco interview question

Algorithm questions...pretty easy