- Where Developers Learn, Share, & Build Careers
I'm trying to re-apply a method, but I am confused because at some point the compiler thinks Is that the function anacvert return list [list [four]] you're combining it with four There are four predictions for a list of lists: The second example is OK: EDIT: How to solve it? Since this is likely to work on Coriseraa, it will leave you. You will have to overturn all the partial solutions returned from Anag (see for assessment) for the whole word and again partial solution. You can also get all permutations of a list with a method permutation from the SlaLa Library: list [list []] instead of list [list [any]] . This is my job:
def anag (wrd: list [character]): list [list [four]] = if (wrd.isEmpty) list (wrd) and wrd.map (l List: [list [character]] = if (wrd.isEmpty) list: = [Gt; l: anag (wrd.tail)) / found: list [list [any]] def anag (wrd: list [character]
l: anag (Wrd.tail) Because the list of wrd.tail type [color]
wrd.permutations.toList < / Div>
Comments
Post a Comment