>>53415672It's an entirely valid question, if phrased properly.
Assuming you have unlimited time and resources to do as many legendary raid battles as you want, and win every time, the goal is to earn 248 candy and 296 candy XL. This can be reduced to 220 candy if starting with a weather boosted raid boss.
Legendary raid bosses give a guaranteed 3 candy XL when caught, which is applied before the random quantity of candy XL rewarded based on a Pokémon's level. Before any other factors, that means you need to catch 99 legendary Pokémon. Catching them is not a certainty, but easier if you know proper catching strategy and technique and have platinum type badges.
A 2021 research article from Silph Road suggests that Pokémon caught at level 20 have an estimated 6/20 chance to drop at least one candy XL, increasing to a 9/20 chance for level 25 Pokémon.
https://thesilphroad.com/science/guide-candy-xl-part-2-catchingThis is prior to the introduction of mega evolution mechanics to increase the drop rate of candy XL.
When this was introduced, it was also investigated it appears that a level 3 mega evolution can give a massive increase to the odds of receiving a candy XL, increasing from 6/20 or 9/20, to 11/20 and 14/20 respectively.
https://www.reddit.com/r/TheSilphRoad/comments/uhno9u/mega_xl_bonus_seems_to_be_massive/If operating on a basic assumption that you'll get 4 candy XL per legendary raid, that drops the maximum number of successful catches to 74, with decent odds to need fewer catches.
This also does not factor in rare candy XL that are rarely awarded for winning in-person raids, or walking a legendary as a buddy.
The 220/248 candy requirement prior to that will be comfortably met, 74 catches with a mega level 3 bonus active will net you 370 candy, assuming you did not use a pinap berry or there was no other event bonus active.
tl;dr - 74 raids at a rate of 4 candy XL per catch for the 296 candy XL needed