A or B

Over the weekend I watched the YouTube video “Dealing with Negative Comments | AMA #3 – Ask Me Anything with Lex Fridman”. I have watched a few of his videos. I do enjoy them to the point that I have subscribed to them. There is one in which Lex interviews Donald Knuth and other where he interviews Andrew Ng. Both videos are over an hour so I will watch them over the weekend.

If you are interested in getting information about Lex Fridman you can find it here or there.

I picked the challenge “A or B” from HackerRank after receiving an email message. I guess that if you solve a few of their problems they like you to continue visiting their site and solving additional challenges. I like to work on one or two a week. I believe it is the only way to learn and / or refresh material. Continue reading “A or B”

The Full Counting Sort

306 Subscribers

Today I decided to solve a HackerRank problem. Randomly I selected The Full Counting Sort. If interested read the requirements. I read the requirements and decided to give it a try.

Based on my experience with this problem you might want to follow my advice. Work on the algorithm and make sure it passes the two sample test cases. Once you are done, submit your solution. If you have a valid approach then chances are that your solution will fail test #5, it will time out. I generated up to three different versions of the countSort() function. I could not get past test #5 because it would time out. I spent time reading the discussions and they did not make much sense. I even bought test #5 for some hackos. By the way, the test includes 1,000,000 strings which I could not download no matter how many times I tried. With this problem do not purchase test #5. You will not be able to run it. Continue reading “The Full Counting Sort”

Flipping Bits

It is Sunday February 02, 2020 (02022020) and today’s date is a palindrome. Lunch yesterday was great. All the food my wife and I cooked turned out quite tasty. Today we will make a salad and sandwiches using a brioche bread loaf that we get at Trader Joe’s. We need to consume simpler and hopefully less food.

I decided to work on HackerRank Flipping bits problem. I decided to use Java 8. The problem has to do with bit manipulations. In my humble opinion, C is a much better suited language than Java. Continue reading “Flipping Bits”

Almost Sorted

In the past few days there have been several announcements by both car and device manufacturers that self driving cars are almost a reality and to make that possible new and cheaper devices are being introduced to help.

It seems that newer LIDAR devices are improving in range and precision while their prices are coming down. This should help. On the other hand researchers are working on algorithms to check that sensors are getting more reliable. I read an article today that LIDAR systems can be tricked to not detect something or to detect something that is not there. Continue reading “Almost Sorted”

3D Surface Area

Good morning. It is Monday January 06, 2020. Last year’s holiday season was rather long. Christmas fell on Wednesday so most companies gave Tuesday as a holiday. On the following week, most companies do not give New Years Eve day as a holiday but most people take it as a personal holiday or vacation day. I work every day (included weekends and holidays). Granted that on weekends and holidays I only sit in front of my computer for only two 2-hour blocks. Continue reading “3D Surface Area”

The Grid Search

It is Saturday morning and I am in my second block of the day. I typically do a couple 2-hour blocks on weekend days. As usual I got up at 05:00 AM and got breakfast ready. During breakfast my wife mentioned that she was not feeling well. Apparently she caught a cold or flu.

We had invited for lunch a couple of her brothers and spouses. One of her brother’s birthday was yesterday.  We decided to change the menu and postpone lunch with family for next Saturday. We had planned a couple of Italian dishes and I was already savoring them. We both enjoy cooking but decided on a single simpler course for lunch. Continue reading “The Grid Search”

To Trie or not to Trie

I am always interested in learning new and refreshing on known algorithms. I looked at a problem in HackerRank which at this time is not relevant. The problem involves looking for sub strings in a string. There are many algorithms that could be used, but as the saying goes, there are many ways to skin a cat, but I always say that one and only one is the best.

I am not going to discuss the some possible approaches to solve the problem in this post. I will take a look at Tries which might be close. Will build a node for the trie, a trie and then will attempt to figure out if by modifying the node and possibly the trie, I can solve the problem. If we are not able to solve the challenge (I do not expect to solve it with a base Trie), will cover a better approach in the next post. Continue reading “To Trie or not to Trie”

Graph Search DFS and BFS

It is Sunday November 10, 2019 around 10:30 AM. As usual get up at 05:00 AM, prepare and have breakfast with my wife, shower, get dressed and go down to my home office for the first two-hour block of the day. I practice the Deep Work technique methodology by Cal Newport. I have been practicing the technique for years and it seems to work for me.

After the first block of the day I prepared tea and my wife and I sat down in the living room to chat. The high temperature yesterday was 44 F. The high for today is 30 and currently we are at 29. Taking in consideration wind, the wind chill is at 19 degrees. We were considering going out to Trader Joe’s to get some tea which we are running low, but we decided to have an early lunch and watch some movies this afternoon on Amazon Prime and Netflix. Continue reading “Graph Search DFS and BFS”

Re-Space

UPDATE – The format for the code for the class TrieNode has been addressed. Sorry for the inconvenience.

It is Friday and my youngest and family will be arriving this afternoon for a weekend long visit. My wife and I are getting ready for their arrival later today. We all enjoy good food so we have an extensive menu planned which includes fugazza, pasta carbonara with lots of pancetta, beef roast with a homemade tomato sauce, limoncello cake and different alcoholic and non-alcoholic beverages.

Let’s get to the main subject of this post. I tackled problem 17.13 from the Cracking the Coding Interview book. The problem is name Re-Space. Continue reading “Re-Space”

Arrays Left Rotation

Last evening I read the article “Programmable Solid-State Storage in Future Cloud Datacenters” by Jaeyound Do, Sudipta Sengupta and Steven Swanson which appeared in volume 62 number 6 edition of Communications of the ACM. This morning I read it once again. As you might already know I am passionate about storage and have been working on it for a while. The article deal with SSD drives and how they can help improve performance by providing compute resources close to the data. Continue reading “Arrays Left Rotation”