A popular app takes 10 seconds to execute on a 11 watt smartphone A, and it takes 8 seconds to execute on a 13 watt smartphone B. The app is a bigger drain on the battery on which smartphone?
According to Wikipedia, 1 Watt equals 1 joule per second; here joule is a unit of energy. Using this, you can come up with a formula that relates the power of a machine, the number of seconds that the machine works, and the amount of energy expended. Using this formula, you can calculate the amount of energy spent in your two scenarios, and deduce the answer to your question.