bhai samjha do or ye combanitorics kya hota hai?
Treasure hunt problem nhi aaya samjh
Hello Sparsh
Yaar is problem mei unhone aapko N strings de rakhi hai, thik hai. Ab aapko aise 2 string uthane hai i aur j jinka max common prefix = M ho.Ab aapka ye M ek fixed value nahi diya jayega but ek range hai jo ki 0 se lekar max(length(ai)) tak hogi, matlab M 0 se lekar sabse lambe string ke length tak jayegi.
Ab in saare M ke liye aapko kitne string milenge jo ki ye satisfy karenge, inke combinations ka sum batana hai.
Combination matlab jaise ki 3rd aur 5th string ka prefix match kar raha maan lo M = 2 ke liye. To (3,5) ek combination hua.
Aise hi har M ke liye combinations jitne banenge unka sum karke output karna hai.
Combinatrics ek maths ki branch hai jo ki permutation, combination, probability se related hai.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.