Nielsen ONE deployments may contain services that depend on other services being deployed first. Given a set of services and prerequisite relationships, generate the deployment waves that respect every dependency while allowing independent services to deploy together.
A dependency [service, prerequisite] means the prerequisite must appear in an earlier wave than the service. Within each wave, return service names in lexicographic order. Return an empty list if the dependencies contain a cycle, because no valid deployment plan exists.
Implement deploy_waves(services, dependencies).
services is a list of unique strings.dependencies is a list of two-element lists, each containing a service and one of its prerequisites.def deploy_waves(services, dependencies):