Company: ZL Technologies
Difficulty: medium
Problem Title: Find Available Ticket Number Imagine you\'re managing a ticket booking application for generating tickets for a conference in your organization. Each ticket has a unique ticket number associated with it starting with 1. However, some tickets were issued incorrectly (e.g., negative or zero values) due to a bug. Your team somehow managed to get all the tickets issued (valid or invalid). Your task is to identify the smallest available ticket number that has not been issued yet, so that you can sell the remaining available tickets. Solve the problem in optimal way with space complexity of O(1) . Input Format The first line contains an integer n - the number of tickets issued. The second line contains n space-separated integers representing the issued ticket numbers. Output Format Print a single integer representing the smallest available ticket number that has not been issued. Constraints 1 ≤ arr.length ≤ 10 5 -2 31 ≤ arr[i] ≤ 2 31 - 1 Examples Input: 5 1 2 0 -1 3 Output: 4