First light the both the ends of the first string and one end of the second string. Now 30 minutes will be passed when the first string is fully burned, that means 30 minutes have passed of the second string. Then light the other end of the second string and when it is fully burned, 45 minutes will be passed. That is how we can measure 45 minutes.