input: Write a python function to train a RandomForestClassifier on a given dataset and return the accuracy on the test set.
  ```python
  assert train_random_forest([[5,2,4,1,3], [7,3,5,1,2], [9,5,4,2,3]], ['iris-setosa', 'iris-versicolor', 'iris-virginica']) == 1.0
  assert train_random_forest([[6,3,4,1,2], [8,4,5,2,3], [10,6,4,3,3]], ['iris-setosa', 'iris-versicolor', 'iris-virginica']) == 1.0
  assert train_random_forest([[5,3,4,2,1], [7,4,6,2,2], [9,6,5,3,3]], ['iris-setosa', 'iris-versicolor', 'iris-virginica']) == 1.0
output: def train_random_forest(X, y):
      from sklearn.ensemble import RandomForestClassifier
      from sklearn.model_selection import train_test_split
      from sklearn.preprocessing import LabelEncoder
      from sklearn.metrics import accuracy_score
  
      # Encoding the labels
      le = LabelEncoder()
      y_encoded = le.fit_transform(y)
      
      # Splitting the dataset into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(X, y_encoded, test_size=0.33, random_state=42)
      
      # Training the RandomForestClassifier
      clf = RandomForestClassifier()
      clf.fit(X_train, y_train)
      
      # Predicting and calculating accuracy
      y_pred = clf.predict(X_test)
      accuracy = accuracy_score(y_test, y_pred)
      
      return accuracy