2 test cases are failing

I have used a different approach, 2 test cases are failing and I am unable to understand where my code went wrong, I m sharing the code link as well for your reference.

I am ready to explain my code anytime at call, as I know it gets difficult to understand someone else’s code.

Please help me out

i understood ur logic pretty much
but the thing is
dekho let’s say
ur first else condition got true for first element aur kuch elements fill hoke agaye but cycle nhi mila
uske bad next element k liye else if(a[i]<0) ye true ho gayi
toh ab kuch elements jo pehle se filled the set mein, they are still there and marked
toh
b.find(j) != b.end() ye true hojaegi
but iska true hona dono m toh possible hai
let’s say 6 elements ka array hai
1 3 5 positivr
and 2 4 6 negativr
ab 4 aur 6 bhi apas m cycle bana sakte hai
zruri nhi hai ki 2 4 6 hi banae teeno
toh vo statement true hai bhi agar toh second wali condition true nhi hori isliye ans 1 set nhi hora but agli condition se break zrur ho gaya
toh ye case kbhi hit hi nhi ho paya