//?  SLIDING WINDOW

//*  Create a function called “longestSubstring” that accepts a string and return the length of the longest substring that contains all unique characters.

//*  In other words, the function should use a sliding window to keep track of the longest substring

function longestSubstring(str){

    // TODO: Find a way to keep track of the length of the "longest" substring, a "start" index, and a way to keep track of what you've "seen" (Hint: Consider using an object)

    // TODO: Loop through the string from the first letter to the end of the string
    for () {
        // TODO: check to see if the letter has been seen. (Hint: if it has been seen, replace the starting value variable with either the current value of that window's current index or the stored index in the "seen" object, whichever one is larger)

        // TODO: for each iteration either keep the current value of longest the same, otherwise replace the value of the variable keeping track of the longest substring with the new longest substring in our window 
        
        // TODO  Hint: keep in mind that as the window changes, we need to be careful about how we calculate the length of the current substring

        // TODO: store the index of the next character in our seen object so that we don't double count anything within our loop

    }

    // TODO: return the value of the longest substring
    return;
}

// TODO: call the longestSubstring function with a valid input
longestSubstring();
