Question d’entretien chez Arista Networks

Leetcode question with basic and optimized approach