Start work on porting hints kitten to Go

This commit is contained in:
Kovid Goyal
2023-03-08 20:06:26 +05:30
parent bcd3802d3e
commit 09ceb3c0be
12 changed files with 523 additions and 12 deletions

View File

@@ -55,6 +55,10 @@ func (self *Set[T]) Iterable() map[T]struct{} {
return self.items
}
func (self *Set[T]) AsSlice() []T {
return maps.Keys(self.items)
}
func (self *Set[T]) Intersect(other *Set[T]) (ans *Set[T]) {
if self.Len() < other.Len() {
ans = NewSet[T](self.Len())