Please ans this ques not able to build logic

503c7f10-d700-45a7-b513-314e19c04a59

hello @sahilkhan2312000131

is this question part of any test?
if not then pls share the link.

It was part of a test which I was not able to answer

pls share the link, i need to solve it and then only i can take ur doubts .

also , ur both the screenshots are removed pls check

Coding Blocks IDE
Please check this code

how can i check?i have never solved it before.
without problem link , i cant help u.

Forget the above problem, Just help me with this:
This is my code to find max length lexographically shortest palindrome substring:
Coding Blocks IDE
It is working fine.
Can u please just solve 2 doubts related to it:

  1. if I take siz=INT_MIN; I do not get any answer. Why??
  2. v.push_back(s.substr(i,j-i+1)); Here I get same answer even If I write j in place of j-i+1. Why??

legnth returns unsigned type integer, and when u compare unsigned int with int then int will converted to unsigned int and then comparision will happen.
INT_MIN is negative number , it will first converted to unsigned and then the comparision happens becuase of thatu r getting weired result.
initilase with non negative numbers to avoid such issues.

if u give more than availabel length in substr then u will get only availabel length string , no other reaosn

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.