I had four parrots and three cages.
If you put one parrot in each cage, you have an extra bird without a cage. However, if you put two parrots in each cage, then you have an extra cage.
Let there be x birds and y cages, then we get the following equations:
y=x-1 (because the number of cages is one less than the number of birds)
and 2(y-1)=x (because two birds in one cage will lead to one extra cage, that is y-1 cages will be required to house x birds).
Solving, we get x=4 and y=3.