This is a perimeter question. Here, we are trying to find how far around the area is. The perimeter of a rectangle is equal to 2 times the length plus 2 times the width, or 2l+2w. In here, the length and width are both 6 feet, so we plug this in.
P=2l+2w
P=2*6 feet+2*6 feet
P=12 feet+12 feet=24 feet
Charlie needed to buy 24 feet of fence.
Hope this helps!