Perimeter of square I the sum of all side. All sides on a square are the same so it can be written as:
P = 4s, s is length of one side
24 = 4s
6 = s
If the square and hexagon share a side then one side of the hexagon is 6 in, a hexagon has 6 sided so perimeter is 6s
P = 6s
P = 6(6)
P = 36