input: from typing import List
  
  def confusion_matrix(true_labels: List[int], predicted_labels: List[int]) -> List[List[int]]:
      """ Compute the confusion matrix from a list of true and predicted labels.
      The matrix rows represent the true classes and columns represent the predicted classes.
      
      >>> confusion_matrix([2, 0, 2, 2, 0, 1], [0, 0, 2, 2, 0, 2])
      [[2, 0, 0], [0, 0, 1], [1, 0, 2]]
      """
output:     n = len(true_labels)
      num_classes = max(max(true_labels), max(predicted_labels)) + 1
      matrix = [[0] * num_classes for _ in range(num_classes)]
      
      for i in range(n):
          true_class = true_labels[i]
          predicted_class = predicted_labels[i]
          matrix[true_class][predicted_class] += 1
      
      return matrix