Pocket Gems Interview Question

Strstr convert ternary expression to tree