- 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 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] 

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:

  l: anag (Wrd.tail) Because the list of wrd.tail type [color]  

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:

  wrd.permutations.toList   < / Div> 

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -