AKUNA CAPITAL interview question

Code the drunk passenger problem in any language