QuantumStreet AI interview question

DSA- basic Q on arrays and trees