how would i go about coding an algorithm that takes a word and gives its anagram? need some help figuring out the steps i need to take. An anagram is a word created by another word by changing the order of the letters. ex. use -> sue. so this would be equal to 3!, so i would get 6 different words correct?
what i was thinking of doing is make a copy of the original word - 1st letter and place that letter at the end of the word, but then at some point i will get the same word again . then take the 2nd letter and place it at the end, then take the 3rd letter and place it at the end again.
or would it be better and more efficient if i ignore the letter all together and focus on arranging the indeces that hold the letters? any suggestions?