Subcontract logic help

So this problem has to do with logic while this similar one below has to do with flow?