题解 | #提取不重复的整数#

提取不重复的整数

https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1

简单呢

#include <iostream>
#include <unordered_set>
using namespace std;
int main()
{
    string str;
    cin >> str;
    unordered_set<char> s;
    for (int i = str.size()-1; i != -1; i--) {
        if (s.find(str[i]) == s.end()) {
            cout << str[i];
            s.emplace(str[i]);
        }
    }
}
全部评论

相关推荐

北枳的南橘:建议大家务必去和他沟通一下,像极了小学生对你侃侃而谈国际局势😂
找AI工作可以去哪些公司...
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务