I dont know how to bitmask since i have never done it

https://hack.codingblocks.com/contests/c/512/136

please provide me with a suitable example and then logic about how to proceed with this question

This question can be done by brute force also

As the constraints given in the question are smal
n<=4 only

So for this question you can even check all possible pairs and see if any subset sum is 0.

You can learn bitmasking from videos of Prateek bhaiya.