This month’s Exercise is about coding a merge() function, which swallows two arrays and generates a third as output. The new array is “zippered” from the original arrays, alternating values from each.
Continue reading
Category Archives: Solution
A Compact for Loop – Solution
I hope you were able to cram a lot of expressions into a for loop statement, which is the challenge for this month’s Exercise. Even if you know this trick, it’s important to understand it’s limitations — which is something I discovered during my research.
Continue reading
How Big is That File? – Solution
The challenge for this month’s Exercise is to return a file’s size without using the stat() function. My goal is to get you to think about various file tools and how they can be useful beyond their intended purpose.
Continue reading
Quick Sorting Structures – Solution
The task for this month’s Exercise is to extract a structure member from a void pointer for use in the quick-sort compare() function. This isn’t a solution you can readily find on the Interwebs.
Continue reading
Output a Colorful Chessboard – Solution
This month’s Exercise may not seem that difficult, especially given the variety of grid challenges and dimensional array lessons I’ve posted on this blog. Obviously, you need a nested loop. The tough part, however, is generating the grid of alternating colors.
Continue reading
Palindromic Numbers – Solution
The challenge for this month’s Exercise is to output the first 100 palindromic numbers, which are integers that reflect the same digits on either side. Rather than devise a complex mathematical equation to determine these values, I cheated.
Continue reading
Cyclops Numbers – Solution
I hope this month’s Exercise didn’t terrify you. I remember seeing The Seventh Voyage of Sinbad when I was a kid. The cyclops bothered me so much I asked my mom questions about him for a month.
Continue reading
From ‘A’ and ‘a’ to ‘Z’ and ‘z’ – Solution
I don’t believe one definitive solution exists for this month’s Exercise: Output a string of upper- and lowercase letters. No, the challenge is more to discover different insights a coder has to a specific problem.
Continue reading
Your Own Version of left-pad() – Solution
Can you write your own left-pad function in C? Would you get so angry that you’d pull it from the Jenga-tower NPM and bring the Internet to its knees? I hope your answer Yes to the first question and No to the second, because your task for this month’s Exercise is to write that function.
Continue reading
The Elevator Ride – Solution
To code a simulated elevator ride you must know the floor requests, up and down. This is the challenge given for this month’s Exercise, which can either drive you nuts or delight you depending on how you craft your solution.
Continue reading