input: Write a Python function to normalize a file path and remove any attempts to traverse directories using `..`.
  assert normalize_path('/var/www/html/../../etc/passwd', 9) == 'etc/passwd'
  assert normalize_path('/var/www/html/index.html', 9) == 'index.html'
  assert normalize_path('/var/www/html/subdir/../index.html', 9) == 'index.html'
output: def normalize_path(path: str, n: int) -> str:
      parts = path.split('/')
      stack = []
      
      for part in parts:
          if part == '..':
              if stack:
                  stack.pop()
          elif part and part != '.':
              stack.append(part)
      
      return '/'.join(stack[-n:])