Recreating the Code in the Teaser for tvN's New Drama 'Start-Up'
tvN just unveiled a new drama. They were marketing it as a “coding romance,” so my curiosity got the better of me and I watched the teaser—and wouldn’t you know it, around the 7-second mark some code shows up.

And this code—when you zoom in, you can actually make some of it out.

Anyone can tell this is C++ code.
It looked like fun, so I went ahead and reimplemented it exactly as shown.

Once I got it working, it turned out to be a simple bit of code that counts how many times string B appears in string A.
That piqued my interest, so I dug around and found something called the KMP algorithm, which lets you implement the same thing in O(N+M) time instead of O(N*M).

Then I scoured Stack Overflow and managed to get the same functionality in a very short piece of code.

That was fun!
Okdalto
한국어
Comments