Find the different characters present in a string

后端 未结 3 1530
粉色の甜心
粉色の甜心 2021-01-20 22:07

Is there any way to find the all the unique characters present in a string without finding all the occurrences of the string ? For example, Let it be s

3条回答
  •  佛祖请我去吃肉
    2021-01-20 23:09

    Sounds uncommon enough that it's not part of the STL.
    I'd simply try iterating through the string and creating / incrementing the count of numbers in a Hashset. Then, grab all the Keys to determine unique values. Good Luck

提交回复
热议问题