code: def getLengthOfOptimalCompression(self, s: str, k: int) -> int:
      # traverse the string
      # keep track of the status of delete or not delete current character
      # the status includes current index, number of delete, the previous character, and the runing length of previous character
      # return the minium length of compresed between delete or not delete
      # O(n^2*26*k) = O(n^2*k) time and space
  
      memo = {}
      return self.dfs(s, 0, k, None, 0, memo)
  
label_desc: Use image node_id 1 for calling the Solution obj's underlying member method code with example usage: obj.getLengthOfOptimalCompression(s, k) and returns: self