I'm currently a 20 year old undergrad studying CS at a reputed institute in my city. I'm one of the very few from my batch who's interested in studying theoretical CS and mathematics (about 10 students from a batch of 200) and want to pursue research as a career.
Thing is, out of these 10 students, I'm the dumbest. I score the least in a graph theory exam, I cannot come up with creative solutions to problems in complexity theory as quick as they can (sometimes I keep on thinking for days, if not weeks, and still cannot come up with anything useful), I'm the student who the professor looks at and wonders: why are they here? To be very honest, I don't really like programming or web development. I like to spend time thinking about stuff, solving problems by hand, and learning fascinating things in logic and modern algebra. I'm weak at exams, true, but then I'm mostly clueless and disinterested in web development classes, where I can score easily but not learn something that I couldn't have learnt by watching tutorials on the Internet. I'm obviously looked down by my peers, too; and my grades are, well... not too great. In my current semester, I'm studying four theory courses (Complexity Theory, Graph Theory, Abstract Algebra and Cryptography) and one introductory CS security course. I'm going through the most difficult time of my academic curriculum so far; getting around 3-4 hours of sleep every day, with most of my day spent in attending classes and solving assignments. I'd like to drop a course from my current roster, but I'm afraid that since that'd show up in my transcript after I graduate, it might ruin my chances of getting into a respected grad school or landing a job.
I was recently diagnosed with manic depression, and while there are a few personal problems I have (premature balding, asocial lifestyle etc.) that might have caused that, some amount of the aforementioned issue might have also contributed to the cause. Anyway, I'm not asking for any consolation.
What I'm asking is: if anyone who's been through similar experiences while pursuing academia, how did you cope up? Even if you weren't like me (chances are pretty high that you weren't like me, CS theory/Math students are usually very intelligent), what do you advice? Should I stop studying theoretical CS due to my frequent failures? I mean, I don't believe in that kind of stuff, but usually if you fail too much at a certain thing, maybe that's some sort of sign or something? I don't really have a lot of friends, and no one from my family has received as much education as I have (so far), so I don't really have anyone I can ask for advice.