Google Interview Question

Truncate a string to given truncated digits