Need help with task 131 Four Pics One Word

Back to General discussions forum

LotvinSergey     2016-10-06 21:24:15
User avatar

Hi, All! Concerning the input data. To find the quantity of possible words we need to find those permutations for input strng. Am I right? For example 7 a r z k i n t s e i i There are 11 letters, but word can be only 7. Imagine that the real word in dictionary that suits is ziiakis So in order to find it in a dicitionary I have to get this variant of letters combination from input string. My only idea for now it is to do all possible permutations and then make all possible 7 letters string from every permutation. But I am afraid it will take a lot of PC resources, hence the idea is wrong. Pls, give a hint what to do. Which direction to go? Thanks!

camel_case     2016-10-06 22:42:54

You don't need to find all permutations. You can do it in the opposite direction. Using your example: Start with 'a', find all 7 letter words that start with 'a'. Then filter that with 'ar'. Then 'arz' None? Try 'ark' and so on... You can make this very fast and efficient by putting the words into a nice data structure (hint: what if your data structure was inspired by task 207 in concept?)

LotvinSergey     2016-10-10 21:33:31
User avatar

Hello, camel_case! I feel your idea is really good. I've solved the problem, but not in the way you gave me. Could you please give more details how shall I use suffix array?

Razka Agniatara     2018-09-22 02:23:11
User avatar

help me to solve this problem... something error i think

moskito     2018-09-23 17:31:06

There aren't any problems here. But indeed this is a more advanced problem, it could be anything in your codes.

sam_bandara     2022-04-20 06:25:37

Hi, In my case, as an example, when I submitted this to my program

    9 m o l b t i c m o y i a l c

I am getting the following answeres (6 possible matching words).

    catalytic
    climactic
    comically
    committal
    illicitly
    liability

but, site says there is only one matching word. I am confused. Cheers!!

gardengnome     2022-04-20 07:21:13
User avatar

Example: Take your first word "catalytic". How many a's do you count? And how many a's are available to you?

sam_bandara     2022-04-20 22:48:05

Thanks mate!! Got it

Please login and solve 5 problems to be able to post at forum