# Help in hackerrank problem

How can I solved this ? Already seen editorial but it is hard to understand.

Try this:

https://www.hackerrank.com/challenges/equal/submissions/code/49311904

I think itâ€™s fundamentally quite a tough problem to explain.

Edit:

Link for people without a Hackerrank account.

4 Likes

Yup. And may be itâ€™s just me but I think that problems on Hackerrank arenâ€™t well-distributed according to difficulty. Letâ€™s say you just take DP as a topic to practice and sort the questions by difficulty, now, the first question is really easy - the direct application of Kadaneâ€™s Algorithm but itâ€™s start getting really tough from there within just 2-3 problems, such as with this one. Compare it to SPOJ or even Codechef, they do have a lot of tough problem but from my experience, the curve of difficulty vs the ith problem is less steep.

2 Likes

Hmmm â€¦ works for me - do you have a Hackerrank account that you are logged into?

@ro_hitt - does the link work for you?

1 Like

Yes, my bad, sorry. It requires you to login. The link works fine.

1 Like

Just solved it this morning

1 Like

Yep, it happens quite frequently, i look at the max score, and think â€śyo this is easyâ€ť and it turns out to be harder than its rated. Lol and easyier problems sometimes are rated as harder, ex. Coin change problem has max score 60.

2 Likes

No , But one you provided cpp file , I have downloaded that.

1 Like

Quick reminder that Two Two is worth a whopping 150(!) points and was once rated as Expert - Iâ€™m pretty sure that difficulty ratings and number of points are assigned at random

3 Likes

Thank you for this problem.

1 Like

Thanks Iâ€™ll try, desperate need some points to get â€śstarsâ€ť in problem solving on hackerrank

1 Like

Nice problem. My bad that I didnâ€™t read carefully that the powers of 2 can only be up to 800, i.e. for any 2^{x}, x can only be in 1 \leqslant x \leqslant 800, I need to learn to read problems more carefully . Then I think, just building up a Trie for the 800 powers of 2 and then searching each substring of T in that Trie would suffice. Someone mentioned in discussion there that Aho-Corasick would do better. So, time to learn that. Thank you for it.

2 Likes