If you do problems per hour, after hours you do problems.
Similarly, your friend does problems per hour, so after he has completed problems.
Since you have the same number of problems, we deduce
which we can rewrite as
If we solve this equation for one of the two variables, for example t, we have
Since p and t are positive integers, p must be at least 4.
Finding integers solutions require a bit of trial and error, and you can figure out that the only positive and integer solution where p > 10 is