Google interview question

They asked me a DSA question to solve with structs