Microsoft Interview Question

Build a function that balances logs