Microsoft interview question

Build a function that balances logs