Rakuten Interview Question

N queen , longest substring without repeating character