Solution for Codilidty PrefixSet task.