turansky
04/06/2019, 12:14 PMSets.difference
?
In Kotlin it will be:
fun Set<T>.difference(other: Set<T>): Set<T>
{
return subtrack(other) + other.subtrack(this)
}
Shawn
04/06/2019, 12:20 PMSets.difference()
method, it doesn’t seem like it works like your code snippet:
>>The returned set contains all elements that are contained by set1 and not contained by set2. set2 may also contain elements not present in set1; these are simply ignored.
Shawn
04/06/2019, 12:20 PMSet.subtract()
seems to already fulfill this requirementturansky
04/06/2019, 12:25 PMShawn
04/06/2019, 12:28 PMsymmetricDifference
method, which I don’t believe Kotlin providesShawn
04/06/2019, 12:28 PM