Neither ADHD or autism makes one "stupid". It just means you think differently than others, and that difference was traditionally perceived as a lack of intelligence because people on the spectrum didn’t mesh as well with how (for instance) the American school system was designed.
Neither ADHD or autism came from nowhere. There are useful traits to both depending on the situation. Hyperfocus can be a real boon if it's focused in the right direction, as example.
You also have to remember that "intelligence" can't actually be measured with a number, despite what decades of IQ tests in media may lead you to believe. IQ tests are pretty flawed, and there are multiple different versions of IQ tests, whose results can vary wildly. You are either good at something, or you aren't. You may be a math wiz, but useless at baking, or vice versa. The professor of physics may deeply desire to learn greek, but have no grasp on language learning.
I've long held that all humans (with obvious exceptions like the brain damaged), are just as "smart" as all other humans. It's just that no two of us are smart in the same way. You have to identify the things you're good at and delve into those, rather than worrying about the things you don't understand.