News for hackers. Stuff that matters.
Re:Ask HN: How do I solve problems/code outside of the book ... by greenyoda on Saturday May 09, 2015 @05:35PM (#9517777)
As another commenter (iovar) wrote, "try to solve this in your head with pseudo code do not overcomplicate it". There's actually nothing about this problem that requires splitting the input into words or storing the words in an array. You can just read one input character C at a time and either write CoC to the output (if a consonant) or copy C to the output (if any other character: vowel, white-space, punctuation, etc.). If a consonant character is capitalized, the one you write after the 'o' should be lower-cased. (Think of it as a Unix filter that copies a transformed version of its standard input stream to its standard output stream, like the Unix 'tr' command.)

Clickable link to original problem: https://www.reddit.com/r/dailyprogrammer/comments/341c03/201...

There are no comments on this comment yet.