In the first 7 minutes, you would expect 34300 gallons of water to flow out:
[tex]\displaystyle\int_0^7f(t)\,\mathrm dt=300\int_0^7t^2\,\mathrm dt=100t^3\bigg|_{t=0}^{t=7}=100(7^3-0^3)=34300[/tex]
But the tank holds at most 6000 gallons, so the tank must get emptied in less than 7 minutes. So there is some times [tex]t=c[/tex] such that
[tex]\displaystyle\int_0^cf(t)\,\mathrm dt=6000[/tex]
You have
[tex]\displaystyle\int_0^cf(t)\,\mathrm dt=300\int_0^ct^2\,\mathrm dt=100c^3=6000[/tex]
[tex]\implies c^3=60\implies c=\sqrt[3]{60}\approx3.915[/tex]