3 ms·
I had a similar experience in college. The assignment was to print out a tree structure with any given initialization values. The professor and everyone else in
by nazgulnarsil 5y ago
I had a similar experience in college. The assignment was to print out a tree structure with any given initialization values. The professor and everyone else in the class printed the tree top down, like tree diagrams in textbooks. This required a bunch of fiddly spacing considerations. I realized that printing it out left to right required far simpler spacing. I think the final code was less than 20 lines with the core logic being 7 lines. The professor was very surprised it worked.