You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, we just add the elements in a set and check whether the length is the same as n or not. If the element is not in the set then it'll have now friends.