Observation is the key.
Notice that, the zoom level is the length of s.Initially, set x = 0 and y = 0. For each digit in s, double the value of x and y. If the digit is 1 or 3, increment x by 1. If the digit is 2 or 3, increment y by 1.