I have a tibble:
df <- tibble(x = c('a', 'ab', 'abc', 'abcd', 'abd', 'efg'))
I want to remove rows that are substrings of other rows, resulting in:
result <- tibble(x = c('abcd', 'abd', 'efg'))
The solution must be quite efficient as there are ~1M rows of text.