add problem 43, move code used by 24,43 into shared