You need to add their rates together.
Cody dug a 10ft by 10ft hole in six hours. That’s 1000 cubic ft of dirt in six hours, which means Cody can dig 200 cubic ft an hour.
Shreya dug the same hole in 7 hours, which means that’s 1000 cubic ft of dirt divided by 7, which is roughly 143 cubic ft an hour.
If they worked together (add the amount of dirt they dug together), they would dig around 343 cubic ft of dirt an hour. Now divide 1000 cubic ft by 343, which is equal to around 2.91 or 3 hours.