Samsara Interview Question

One easy string and Three matrix problems