Frage im Vorstellungsgespräch bei Meta

Algorithm questions, both were really easy