Is there a shorter or better method of finding
if 2 strings are an anagram in one line code?

Write an idiom that takes two character vectors as its left and right
arguments and returns 1 if they are anagrams of each other. An anagram
of a string uses all of the letters

of the string ignoring word spacing, capitalisation, and dot.



 anagram=: 13 : '(/:~(B,a.) {~ (A,a.) i.~~  (-.&'' .'')y)-:
/:~(B=.((97+i.26){a.),a.) {~ (A=.((65+i.26){a.),a.) i.~~  (-.&''
.'')x'





   'Dr. K. E. Iverson' anagram 'Knives Or Red'

1


Gian Medri
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to