Category: General Computer Science
All the things related with Computer Science theoritically, platform agnostic
Let’s roast! Today’s Leetcode challenge is: 648. Replace Words Given a list of dictionary words, replace all words in the given sentence that has the prefix of the word match to the dictionary word, into that prefix. So, if we have a dictionary word “cat” and a sentence “the cattle”, we replace “cattle” into “cat” since “cat” is a prefix of “cattle”, hence producing the resulting sentence “the cat”. It...
Let’s do some code-roasting, shall we? 😛 Today’s Leetcode challenge is straightforward: “Longest Palindrome.” The problem statement is simple: given a string consisting of lowercase and uppercase characters, return the longest palindrome length that can be built with the supplied letters. This is a simple counting problem that can be solved by counting the appearance of the characters in the string. If a character appears as many as even times,...
I was bored yesterday, so I decided to play with Leetcode, but by coding it in assembly. I initially got inspired by the Indonesian tech discourse to solve the simple “Add Two Numbers” problem using assembly (Link to tweet). Then it comes to my mind, how if I solve other problems with assembly as well. Then I delved into the rabbit hole of playing with the x86 instruction sets. I...
Since I rented my current VPS web last year, I had been using CentOS 7.4 for its operating system. It is derived from Red Hat Enterprise Linux (RHEL) project which offers similar stability to an enterprise-grade server. Unfortunately, a few days ago I discovered that some packages in CentOS were really outdated, even on the latest version (7.6). Those packages are related to software development, such as GCC, Clang toolchains,...
I was invited for students dinner at Cppcon. Technically speaking I am currently a student, so despite I’m older than many other students, I can join them for free pizza 😛 But my luck was not about the pizza. I got my chance to meet and talk with Bjarne Stroustrup, the father of C++ language! It was all began when all students joining the dinner had to meet up in...
So I decided to move my blog from shared hosting so VPS hosting. VPS is getting cheaper everyday with as low as $2 per day makes it a good bargain to host blog in VPS. With VPS, we can choose which software we want to install, and configure it in our own taste. But definitely, choosing VPS is not for everyone. It is more suitable for advanced user as configuring...
Previously I was talking about generics. You can see how I do with generics to the confusing level: See how many < > to feast your eyes.
You usually save your code on your development machine. When you need to share your code with your friend, or perhaps when you use multiple development machine such as desktop and laptop simultaneously, you share your code by copying the entire folder and share it to your liking. This is a very bad practice, especially when sharing involves changes and development from other party. Because of that we need a...