Return shortest unique prefixes

shortest_unique_prefixes(strings, min_length = 1)

Arguments

strings

A character vector

min_length

Minimum length of prefixes

Value

Character vector with shortest unique prefixes

Examples

strings = c("Abra", "Abracadabra", "Simsalabim")
shortest_unique_prefixes(strings)
#> [1] "Abra"  "Abrac" "S"