Given a fake `hash(a, b)` that returns `` `${a}|${b}` ``, write `root(leaves)` folding pairs left-to-right until one value remains (duplicate the last leaf when the count is odd).
Required in your answer: whilehash(
Runs in a sandboxed worker
const hash = (a, b) => `${a}|${b}`;
function root(leaves) {
// TODO
}