Answer:
L/2
Step-by-step explanation:
Neglect any air or other resistant, for the ball can wrap its string around the bar, it must rotate a full circle around the bar. This means the ball should be able to swing to the top position where it's directly above the bar. By the law of energy conservation, this happens when the ball is at the same level as where it's previously released vertically. It means the swinging radius around the bar must be at least half of the string length.
So the distance d between the bar and the pivot should be at least L/2