LeetCodeLast Moment Before All Ants Fall Out of a PlankLast Moment Before All Ants Fall Out of a PlankMediumArrayBrainteaserSimulationSolution export function getLastMoment(n: number, left: number[], right: number[]): number { let result = 0; for (const i of left) { result = Math.max(result, i); } for (const i of right) { result = Math.max(result, n - i); } return result; }LeetCodeLast Moment Before All Ants Fall Out of a Plankhttps://leetcode.com/problems/last-moment-before-all-ants-fall-out-of-a-plank