Company: ibm_22oct
Difficulty: medium
Maximize Consecutive Hidden Commits Problem Description You are working with a Git-based version control system. Each commit in a repository has a unique integer ID representing its timestamp, and the list of commit IDs is given in ascending order. The commit history is complete and consistent. You are auditing this history and want to test how many consecutive commits can be temporarily hidden (e.g., by a UI filter) such that the remaining visible commits still allow someone to deduce which commits were hidden uniquely. You are allowed to hide a contiguous block of consecutive commits. Implement a function to maximize the number of commits hidden while ensuring the surrounding commit history clearly defines the hidden range. The function getMaxConsecutiveHidden takes the following input: int commits[]: unique integers in ascending order The function should return an integer, which maximizes the number of commits hidden. Examples Example 1: Input: commits = [1, 3, 4, 5, 6, 9] Output: 2