* 
 * @param arr int整型一维数组 the array
 * @return int整型
 */
function maxLength( arr ) {
    // write code here
    let temp = [];
    let max = 0;
    for(let item of arr) {
        let index = temp.indexOf(item);
        if(index !== -1) {
            temp = temp.slice(index+1);
        }
        temp.push(item);
        max = Math.max(max,temp.length);
    }
    return max;
}
module.exports = {
    maxLength : maxLength
};