necklace.cpp: In function 'int main()':
necklace.cpp:23:21: warning: array subscript has type 'char' [-Wchar-subscripts]
23 | for (auto u: s) a[u]++;
| ^
necklace.cpp:26:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
26 | for (int i = 0; i < t.size(); i++) {
| ~~^~~~~~~~~~
necklace.cpp:27:15: warning: array subscript has type 'char' [-Wchar-subscripts]
27 | if (a[t[i]]) {
| ^
necklace.cpp:32:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
32 | for (int i = 0; i < s.size(); i++) {
| ~~^~~~~~~~~~
necklace.cpp:38:32: warning: 'ans1' may be used uninitialized in this function [-Wmaybe-uninitialized]
38 | cout << 1 << '\n' << ans1 << ' ' << ans2 << '\n';
| ^~~
necklace.cpp:38:47: warning: 'ans2' may be used uninitialized in this function [-Wmaybe-uninitialized]
38 | cout << 1 << '\n' << ans1 << ' ' << ans2 << '\n';
| ^~~~
necklace.cpp:33:5: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
33 | if (s[i] == ans) {
| ^~