I was taught as "Ofcourse" at my school but, recently I've learned from the dictionary that this word doesn't exist! Instead, "Of course" was valid.
But when we speak we consider it as a single word or was that my misunderstanding? Is there any variation like "ofcorse" (maybe colloquial) without the letter
u as a single word?
There is no single-word variant, Sameer.
There is only 'of course' (two words).
It is just one of those mistaken ideas that we sometimes get when learning a new subject.
The idiomatic phrase "of course" is in the dictionary.
You are right in that the dictionary will conform to standard usage. But, in this case, standard usage is a two-word phrase.