1 判断集合中是否包含指定元素 --> 判断coin 是否在coinSet 集合中
if (!coinSet.contains(coin))
contains是Collection接口中的方法,用于判断集合中是否包含指定元素。
例如,如果list是一个List<String>类型的集合,
可以通过调用list.contains("hello")方法来判断list中是否包含字符串"hello"。
2 获取两个List的不同值-> for一个集合的每个值, 再看这个值是否再另一个集合中
for (String coin : curCoinSet) {
if (!coinSet.contains(coin)) {
diff.add(coin);
}