Block Interview Question

String manipulation and Matrix traversal