input: Write a python function to encode categorical labels using LabelEncoder and split dataset into train and test sets.
  assert encode_and_split(np.array([[255, 0, 0], [0, 255, 0], [0, 0, 255]]), np.array(['red', 'green', 'blue']), 0.2) == 4
  assert encode_and_split(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), np.array(['a', 'b', 'c']), 0.5) == 4
output: from sklearn.preprocessing import LabelEncoder
  from sklearn.model_selection import train_test_split
  import numpy as np
  
  def encode_and_split(X, y, test_size):
      le = LabelEncoder()
      y_encoded = le.fit_transform(y)
      X_train, X_test, y_train, y_test = train_test_split(X, y_encoded, test_size=test_size, random_state=42)
      return len(X_train) + len(X_test) + len(y_train) + len(y_test)