Citadel Interview Question

How to reverse a string, construct a matrix