input: Write a python function to encrypt a string by mapping each character to its last occurrence position.
  assert encrypt_string("hello") == "01234"
  assert encrypt_string("test") == "0203"
  assert encrypt_string("encryption") == "0123456789"
output: def encrypt_string(s: str) -> str:
      last_occurrence = {}
      result = []
      for idx, char in enumerate(s):
          last_occurrence[char] = str(idx)
          result.append(last_occurrence[char])
      return ''.join(result)