Campbell Ritchie wrote:Welcome to the Ranch
Please show us what you have got so far. What algorithm are you using to find the permutations and combinations?
There are three kinds of actuaries: those who can count, and those who can't.
Piet Souris wrote:Haven't looked at your code, but a method that spawns all permutations of a Collection is always useful. Note that there are n! permutations, if the Collection has size n (if there are no duplicates in that Collection).
However, knowledge of all permutations is not necessary in this case.
Lets say that our given word is "TCA". If we sort the characters, then we get "ACT". Note that "ACT" is a permutation of "TCA". Now suppose our list contains the word "CAT". Since it has the same number of characters as our key, "CAT" might be a candidate. If we sort the characters, we get "ACT". Hey, that is equal to our sorted key, meaning that "ACT" and "CAT" are permutations (or anagrams)! What now?
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
There are three kinds of actuaries: those who can count, and those who can't.
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
Jesse Silverman wrote:I noticed a Freudian Slip in Piet's GUI
Jesse Silverman wrote:, but mostly wanted to say: (...)
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
The bitwise left shift operator, with and without a combination with assignment.Nathan Delsein wrote:. . . What does "<<=" mean? . . .
Nathan Delsein wrote:Next step, how can I find the original words? For instance: the program returns "abc" for "bac" (a french word), but how can I order the letters back to their original position to give me the real word?
Nathan Delsein wrote:I MADE IT !!! Thanks a lot!
There are three kinds of actuaries: those who can count, and those who can't.
Carey Brown wrote:It would be of help to others with similar problems if you would post your solution(s) back here.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn KlassenKoop
https://coderanch.com/wiki/718759/books/BuildingWorldBackyardPaulWheaton
