← Code LabJavaScript0/50 solved · 0%
Web3 · hard

49. Merkle-style folding

Pairwise hashing in JS.

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(