Pinterest Interview Question

Question about truncating a number representation with some basic logic using strings and loops