We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Your answer is hilarious. Nice hack. And you understand it wouldn't work if you get a duplicate relation, right? Like if the test set includes (1,2),(1,2). Your function would print NO, while this describes a valid funcition. But kudos for the insight!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Functions or Not?
You are viewing a single comment's thread. Return to all comments →
Thanks for adding the io code, very helpful.
Your answer is hilarious. Nice hack. And you understand it wouldn't work if you get a duplicate relation, right? Like if the test set includes (1,2),(1,2). Your function would print NO, while this describes a valid funcition. But kudos for the insight!