Implement nested template string substitution | Waymo Interview Question