What is an easy way to tell if a list of words are anagrams of each other?

前端 未结 10 1976
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 18:38

How would you list words that are anagrams of each other?

I was asked this question when I applied for my current job.

orchestra can be rearrang

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 19:09

    Put all the letters in alphabetical order in the string (sorting algorithm) and then compare the resulting string.

提交回复
热议问题