【发布时间】:2017-12-09 23:05:49
【问题描述】:
我想要一些在数组中插入数字的逻辑,同时它会检查当前数字是否已经存在于数组中。请帮我解释一下逻辑。
【问题讨论】:
-
展示你的努力。
-
到目前为止您尝试过什么?你的尝试是如何奏效的,还是没有奏效的?请花一些时间阅读the help pages,尤其是名为"What topics can I ask about here?" 和"What types of questions should I avoid asking?" 的部分。还有read about how to ask good questions。最后请学习如何创建Minimal, Complete, and Verifiable Example。
-
看来你需要的是 OrderedSet 而不是 Array。
-
@ShenLei 为什么不是无序集?