“Perhaps the most widely known story of the origin of the expression concerns the area around the triangular-shaped Flatiron Building at Madison Square in New York City. The building is located on 23rd Street at the intersection of Fifth Avenue and Broadway, and due to the shape of the building winds swirl around it. During the 1920s, groups of men would allegedly gather to watch women walking by have their skirts blown up, revealing legs, which were seldom seen publicly at that time. Local constables, when sometimes telling such groups of men to leave the area, were said to be “giving them the 23 Skidoo”.”
— 23 skidoo (phrase) on Wikipedia