Not able to find the error in the code for CHEFWORD

Following is the link of my submission for CHEFWORD

1 Like

There is a very important line mentioned at the end of the problem statement. What is the probability that CHEF’S string transforms to a “distinct” string in the given list of strings. Your code doesn’t check the given strings for uniqueness. Eg:- i give you aaa to be transformed into 4 strings… ccc, ccc, ccc, ccc. You code will check the probability for all 4 and add up. Although only 1 unique string, ccc, is present. So you just have to calculate it for one.


Thanks buddy, but the distinct part is not mentioned verbose.
Its just "probability that after exactly K claps Chef’s word will equal one of the words from list? "
one from the list means uniqueness was a bit tough to understand

@amritkrs, yupp that was an edge case to identify. You are right, it isn’t mentioned. Solved it quite a few days ago, so got confused. Anyway, that’s the problem.