Still the test case is not passing https://ide.codingblocks.com/s/251434?_ga=2.5735411.1540055023.1591722805-1065040252.1574616549

at line 25 I have done exactly what you are asking me to do with your code in line 32

Hello @Nidhi_Alipuria,

Mistakes in the code you have shared:

  1. You are passing int to prime function.
    As per the constraints given in the question, the number can be greater than the range of int.
    Solution:
    use long long.

  2. stoi() function won’t help.
    Reason:
    it only returns an int value

  3. As you have to maximize the subarray, so first check for all substrings of length 1 and then increase the size.

Corrected Code:

Hope, this would help.
Give a like if you are satisfied.

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.