In the code, he didnt check if freq array element is greater than equal to 2 or not
Pigeon hole code
@rohitgarg025 we are using nC2 formula, ie n(n-1)/2
n >= 0 here
if n == 0, then expression is 0*(-1)/2 = 0
if n == 1, then expression is 1*0/2 = 0
so there is no need to check
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.