The problem with the question regarding 24 - and it's a specific number - Top 40 Hits is finding which artists had EXACTLY 24 hits!
Armed with the Guinness Book of Hit Singles, I thought, at first, that the Beatles had had 24 hits until I looked in the righthand column and found that 'My Bonnie' only reached 48 - 24 became 23.
Now, take The Shadows [yes, the good old Shadows]. They had 25 records which reached the Top 40 BUT 'Kon-Tiki' appears twice because it reached the Top 40 as a re-entry in late '61. If you discount the re-entry, then you have the 'magical' 24!
Elvis and Cliff both had way in excess of 24 hits each; Bob Dylan had merely 11. It may amaze you learn that Buddy Holly, who died in 1959, had 13 Top 40 hits in the '60s, one of which - 'What To Do' - appears twice, in 1961 and 1963.
In short, I am none the wiser!