One test case didnt pass

hello @ashishxmathew have you seen the constraints for this question ?

as the constraints are high therfore you need to implement a optimised approach.

if we make the condition i <=n/2 then is it optimized

@ashishxmathew this is the updated code .


tell me if you dont understand anything .

what is int32_t that is used with main??
also while submitting im getting compiler error

source.cpp:2:1: error: ‘int32_t’ does not name a type
2 | int32_t main()
| ^~~~~~~

now its working i forgot to add iostream and namespace before… but i still dont understand the int32_t

@ashishxmathew see it is very simple and good way to do .
if you have noticed that i have define int as long long int .
so because of this i have to declare int in int main as int32_t main() .
it is just the syntax so that you dont have to define long long everywhere for that i have declared int only as long long int .
if you still have doubt you can ask here .
and if your doubt is resolved you can now mark this doubt as resolved and give the star ratings .
Happy Learning !!