Tagged: C#

Leetcode Roasting of the Day: Replace Words

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...

Another Roasting the Leetcode of the Day: Hand of Straights

Today’s Leetcode is: 846. Hand of Straights (https://leetcode.com/problems/hand-of-straights/) The general idea is extremely simple: given a list of numbers, divide the numbers equally into multiple lists with k size, where each elements are consecutive numbers. For example: List [1,2,3,6,2,3,4,7,8], divided into list of 3 elements will be: [1,2,3],[2,3,4],[6,7,8]. Make a function to check IF we can make such list or not. I am checking the provided solution by Leetcode, and...

Code Roasting the Leetcode Submission

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,...

GPS Library for Windows 10 IoT and Raspberry Pi

I am tinkering with Raspberry Pi 3 (RasPi) and Windows 10 IoT Core. I was thinking how to build an IoT device with GPS functionality in RasPi. Many IoT projects employ GPS module but they use it mostly with Arduino to build quadcopter. Some people tried it with RasPi, but they use it in Raspbian OS. No one seems tried to build directly with RPi and Windows. So, I made...

Generics in WCF REST JSON Communication

Overview So I got a task in designing a scalable and modular Service Oriented application using JSON and WCF. I am designing a web service using WCF. The communication between the web service and the client will be using JSON. While the server is using .NET Framework, the client is using Android Java. I aim to design the service as modular as possible. For every web service request from the client,...