ByteDance Interview Question

String manipulation and graph questions