While I was waiting for some tests to complete I checked my Gmail and found a message from HackerRank suggesting a challenge. The Equal Stacks challenge may be found under Practice > Data Structures > Stacks > Equal Stacks. I read the description for the problem and decided to tackle it using stacks; how creative of me. Continue reading “Equal Stacks”
A day or so ago I saw the Twitter post 246 LRU Cache from LinkedHashMap by Dr. Heinz M. Kabutz. What called my attention was that a few weeks ago I was reading a paper on caching and spent some time (and generated some posts) on the subject LFU Cache I, LFU Cache II and LFU Cache III. Continue reading “LRU with LinkedHashMap”
Ditto. This post covers the continuation of the original proposed (by me) challenge to HackerRank. Seems that I made the mistake to generate the post New, Duplicate or in Segment – Part 2 which describes this challenge. As you can verify I did not suggested a solution. Apparently that was enough to disqualify this entry. Next time I come up with a proposed challenge will not post a thing about it. Continue reading “New, Duplicate or in Segment – Part 4”
I received a message from HackerRank indicating that they would not be able to use the New, Duplicate or in Segment proposed (by me) challenge because I had already made a post in my blog. I thought it would be fine if I did not describe a possible solution. I guess I was wrong.
Within the specified range label each received integer as “New” if the integer is being processed for the first time, “Duplicate” is the integer is not in a segment but has been processed before or “In segment” if the integer is part of a segment of two or more integers. Continue reading “New, Duplicate on in Segment – Part 3”
Guava by Google contains the BiMap class which implements a bi-directional map. On many occasions I have been using a Map and had the need to invert it to use the values as keys. It is doable but somewhat cumbersome. You can always use two maps (key -> value and value -> key) but on many occasions you may run into the issue that the values are duplicated and the second map will have to deal with duplicate keys. This elegant class available in Guava may be of assistance. Continue reading “Guava -BiMap”
Not to be confused with the fruit, Guava is an open source, Java based library developed by Google. It provides utility methods for collections, caching, primitives support, concurrency, common annotations, string processing, I/O, and validations.
I have been experimenting and using the Google Guava library for a few months. Most of features are quite nice and useful (e.g., Multimaps). In this post I show how easy it is interact with multimaps. Continue reading “Guava – Multimap”
As we all know change is always confronting us. A couple years ago I decided to put a lot more emphasis on polishing on my Java by reading, learning and refreshing concepts. I will continue to do so but will relegate it to a second plane. For the next few months I will put emphasis on C++. Continue reading “More Emphasis on C++”
I received an email message from HackerRank inviting me to solve the Ice Cream Parlor challenge. It seems like I have already solved the challenge as illustrated in the Ice Cream Parlor – Part II post. On several occasions I have received invitations to solve challenges that I have already addressed. Perhaps HackerRank did not like my solutions ;o)
On this post I will address the Count Luck challenge from HackerRank. You can read in the discussions section how the challenge was initially given an easy difficulty level and then changed to medium. There is a reference to the Connected Cells in a Grid – Follow Up challenge which I have already solved in this blog. In retrospect, for me this challenge was harder than the one mentioned in the discussion. Continue reading “Count Luck”
Last Friday afternoon I stopped by to donate blood to the Red Cross. I do this twice a year. As usual, I made an appointment. Earlier that day filled the RapidPass, and had a copy of the ticket in my cell phone. The staff at the blood collection site was running behind. After over an hour wait I was called. It took a while to get the process started. The actual donation took no more than 10 minutes. I will be back on fall later this year. Hope the entire process speeds up :o) Continue reading “Connected Cells in a Grid – Follow Up”