
This function counts the number of distinct elements across all sequences, where each sequence is split by spaces.
count_distinct_elements(sequences)
An integer representing the number of distinct elements across all sequences.
A character vector where each element is a sequence of elements separated by spaces.
sequences <- c('hello world', 'hello world hello', 'hello world hello world')
count_distinct_elements(sequences)
Run the code above in your browser using DataLab