#include <iostream>
#include <limits>
#include <bitset>
int main()
{
constexpr char cstr[] = "introduction";
std::bitset< std::numeric_limits<unsigned char>::max() + 1 > present ;
std::bitset< std::numeric_limits<unsigned char>::max() + 1 > repeating ;
for( unsigned char u : cstr )
{
repeating[u] = present[u] ;
present[u] = true ;
}
for( unsigned char u : cstr ) if( present[u] && !repeating[u] && u != 0 )
{
std::cout << "first non-repeating char is '" << char(u) << "'\n" ;
break ;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bGltaXRzPgojaW5jbHVkZSA8Yml0c2V0PgogCmludCBtYWluKCkKewogICAgY29uc3RleHByIGNoYXIgY3N0cltdID0gImludHJvZHVjdGlvbiI7CiAKICAgIHN0ZDo6Yml0c2V0PCBzdGQ6Om51bWVyaWNfbGltaXRzPHVuc2lnbmVkIGNoYXI+OjptYXgoKSArIDEgPiBwcmVzZW50IDsKICAgIHN0ZDo6Yml0c2V0PCBzdGQ6Om51bWVyaWNfbGltaXRzPHVuc2lnbmVkIGNoYXI+OjptYXgoKSArIDEgPiByZXBlYXRpbmcgOwogICAgZm9yKCB1bnNpZ25lZCBjaGFyIHUgOiBjc3RyICkKICAgIHsKICAgICAgICByZXBlYXRpbmdbdV0gPSBwcmVzZW50W3VdIDsKICAgICAgICBwcmVzZW50W3VdID0gdHJ1ZSA7CiAgICB9CiAKICAgIGZvciggdW5zaWduZWQgY2hhciB1IDogY3N0ciApIGlmKCBwcmVzZW50W3VdICYmICFyZXBlYXRpbmdbdV0gJiYgdSAhPSAwICkKICAgIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgImZpcnN0IG5vbi1yZXBlYXRpbmcgY2hhciBpcyAnIiA8PCBjaGFyKHUpIDw8ICInXG4iIDsKICAgICAgICBicmVhayA7CiAgICB9Cn0KIA==