CB NUMBERS PROBLEM

https://ide.codingblocks.com/s/296473 MENE YEH QUESTION SOLVE KARA HAI LEKIN ISME EK TEST CASE NI CHAL RHA, EK BAAR CODE CHECK KARLO KYA DIKKAT HAI.

hello @CODER_JATIN
a) cb number need not to be a prime number number.

b) also logical issue is also there .
try greedy approach for this problem.

bhaiya, greedy approach vegarah to abhi tk bhaiya ne padhaya ni?

greedy approach se mere matlab tha ki pehle hum saare 1 length cb number find karnege fir , 2 lengt sb number ,and then phir 3 …length so on.
aisa hum isliye karegenge kyunki hame cb numbr maximize karne hai.

check implementation here->

bhaiya yeh approach dekhna ek baar https://ide.codingblocks.com/s/300597

nahi ye kaam nahi karega.

try to do it in this way->

okay and bhaiya yeh ek ā€œSANKET AND STRINGSā€ wala question hai dekhna sample output same hai ekdum lekin test cases pass ni ho rhe https://ide.codingblocks.com/s/300612

DOUBT KA LINK BHEJO …

Brute force logic pass nahi hoga kyunki constraint kafi jada hai.

try to think of O(n) logic.
hint->two pointers

https://ide.codingblocks.com/s/300655 bhaiya dekhna ek baar core dumped kyo aa rha?