haskell - Compare two strings and display characters in both strings -


i need function displays chars, on 2 given strings same volution.

example:

checkchars “aabbcf” “aabce” => “ac”

what got:

import data.list  import data.map checkchars b = nub $ intersect b      

this intersects 2 lists, after need code counts chars , filters it. possible?

no idea if want, assume want output letters occur same number of times. it:

checkchars b = concatmap (take 1) $ intersect (group (sort a)) (group (sort b)) 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -