Amazon Interview Question

Build a string based on a random adjacent list