HackerRank C++ Solution – No Prefix Set

Опубликовано: 19 Март 2026
на канале: JustWriteTheCode
1,480
4

I JustWriteTheCode of the solution to the "No Prefix Set" problem present on HackerRank (1 Week Preparation Kit - Day 7).

Programming Language: C++.

Problem:
There is a given list of strings where each string contains only lowercase letters from a-j, inclusive. The set of strings is said to be a GOOD SET if no string is a prefix of another string. In this case, print GOOD SET. Otherwise, print BAD SET on the first line followed by the string being checked.

Note: If two strings are identical, they are prefixes of each other.