A string s is LUCKY if and only if the number of different characters in s is a fibonacci number. Given a string consisting of only lower case letters , output all its lucky non-empty substrings in lexicographical order. Same substrings should be printed once.
a string consisting no more than 100 lower case letters.
output the lucky substrings in lexicographical order.one per line. Same substrings should be printed once.
aabcd
a aa aab aabc ab abc b bc bcd c cd d
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题
扫一扫,把题目装进口袋
扫描二维码,进入QQ群
扫描二维码,关注牛客公众号