# アルゴ式: 881 Q6. distinct にせよ (1) (Swift)

## [Q6. distinct にせよ (1)](https://algo-method.com/tasks/881)

- 最初にSetを使って単純に解いてしまった
- ちょっと楽しすぎかなと思って、辞書を使って再実装
- とはいえ、そこまで雰囲気は変わっていないからな…
- プログラミングの基礎を学ぶ面と、言語の機能を活用するのとどっちも正義な分、どちらを優先するべきか迷う
- 毎回、Swiftの[DictinoaryのcountはO(1)](https://developer.apple.com/documentation/swift/dictionary/3017863-count)だと確認している気がする

[editorial]: https://algo-method.com/tasks/881/editorial

### 提出

- [`Set`](https://algo-method.com/submissions/400333)
- [`Dictionary`](https://algo-method.com/submissions/400345)
