For this Question: Given a string s, find the length of the longest substring without repeating characters.

<b>Note</b> : String contains spaces also.First Line contains the input of the string.

<b> Constraints </b>
1 <= string.length <= 50000
s consists of English letters, digits, symbols, and spaces.Print the length of the longest substring without repeating characters.Sample Input: 
abcabcbb

Sample Output:
3

Explanation: The answer is "abc", with a length of 3., I have written this Solution Code: /**
 *      Author : tourist1256
 *      Time   : 2022-01-08 12:34:09
 **/

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 2351
#endif

int main() {
    string s;
    getline(cin, s);
    unordered_map<char, size_t> last_occurrence;
    size_t starting_idx = 0, ans = 0;
    for (size_t i = 0; i < s.size(); ++i) {
        auto it(last_occurrence.find(s[i]));
        if (it == last_occurrence.cend()) {
            last_occurrence.emplace_hint(it, s[i], i);
        } else {
            if (it->second >= starting_idx) {
                ans = max(ans, i - starting_idx);
                starting_idx = it->second + 1;
            }
            it->second = i;
        }
    }
    ans = max(ans, s.size() - starting_idx);
    cout << ans << "\n";
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?