converting all IEnumerables to HashSet<int> in GetCandidates()

since the various IEnumerables would be used multiple times in linq
query, having them as HashSet would make accesses O(1). Found
significant performance improvement in algo with this change