Unique Binary Search Trees

It has been raining all day in the Twin Cities of Minneapolis and St. Paul. The good thing is that there has been little lightning. I was going to replace an old UPS that I am using to power my main computer in which I develop all the code for this blog, but it was not necessary. I will replace the UPS over the weekend. Continue reading “Unique Binary Search Trees”

Intersection of Two Arrays

Good day fellow software developers and engineers! It is a gloomy day in the Twin Cities of Minneapolis and St. Paul. Hopefully the weather is nicer in your neck of the woods.

Today I picked up the LeetCode 349 Intersection of Two Arrays problem. To be honest with you I do not recall why I did it. Due to thunderstorms I had to power down my computers a couple times today. I just lost track of the reason why I picked this problem. Continue reading “Intersection of Two Arrays”

Reverse String II

The end of my workday is approaching shortly. Hopefully I will be done with this post soon; otherwise will finish it tomorrow.

Earlier today I was snooping around in the LeetCode website. For the first time I ran into a page that shows every submission you make for a problem. Perhaps I am mistaken, but it seems that the site counts as attempts every submission you make. For example, you ran your first pass and let’s say it is accepted but you want to learn more by improving performance. You may even generate one or more implementations. It seems that they count against you. This seems awkward to me. If I am trying to learn I should not be penalized. If my assumption is incorrect, PLEASE LEAVE ME A NOTE BELLOW SETTING ME STRAIGHT. Continue reading “Reverse String II”

Find K Pairs With Smallest Sum

Happy Monday! Hope your day and week has started on the right note. With travel opening in Europe many are making plans and some are already travelling to Europe. It seems that most countries are eager and hopefully able to receive visitors in a safe manner.

Spoke with my youngest son this morning. He was heading to his office. Since the pandemic started he has been working from home like most people in the world has including me. Since the pandemic appears to be under control in many countries, including the USA, schedules are quickly changing and most people will be full time at the office at their place of work. Some companies will allow more flexibility than before with schedules allowing employees to work one or two days from home. Keep in mind that most studies have determined that face contact and casual meetings are associated with more productivity. Interesting fact, because most of us thought that chatting by the water cooler was a complete waste of time! Continue reading “Find K Pairs With Smallest Sum”

Kth Smallest Element in a Sorted Matrix

This is Thursday and a template summer day in the Twin Cities of Minneapolis and St. Paul. The highs for today have been forecasted in the low to mid 70s F. Overall the temperatures a lower than usual.

Earlier this morning I watched the NewScientist DEBATE “Information and the future of defense” presented by BAE Systems. It was interesting. The panel had a moderator and if I recall four contributors with very good credentials in the topic at hand.

In my humble opinion, cyberwarfare is a very serious threat brought by bad actors which may represent organizations or states. Since they can be very damaging and are constantly morphing, AI should be employed to determine the threat in a very short time (e.g., milliseconds), block it, and bring harm to the actors. There is an old saying, if force does not solve your problem, you are not using enough. I will not go into more detail at this time, but chatting, discussing and signing agreements between good actors will never stop bad ones. Continue reading “Kth Smallest Element in a Sorted Matrix”

Count Sub Islands

It is Thursday July 01, 2021 in the Twin Cities of Minneapolis and St. Paul. The forecast called for a sunny day but clouds have rolled in and out. Hopefully it will not rain.

After having breakfast, my wife and I went out on our daily walk. We run into several people we know. Perhaps people want to get in their workout before heading out for the long weekend. The fourth of July falls this Sunday, so the observed Independence Day (United States) is Monday July 05, 2021.

We do not have plans for the holiday. We will stick to our daily routine. I will try to get in one or two work-blocks each day in addition to do groceries and visit the Farmers Market in St. Paul. For one reason or another this year we have not shopped there yet. Continue reading “Count Sub Islands”

The Full Counting Sort – Issue resolved

Good day. Hope all is going well with you. As you will read in this post, something different and perhaps unique occurred. I clearly recall solving this problem and making a note that I had to modify the test code offered by HackerRank. Earlier this morning I received the following email message:

[JohnCanessa/FullCountingSort] Test Case 5 doesn't works (#1)
Inbox

Prateek <notifications@github.com> Unsubscribe
1:19 AM (14 hours ago)
to JohnCanessa/FullCountingSort, Subscribed

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Apparently a HackerRank problem I solved 17 months ago stopped working. Not really. It seems that it was too slow. Test case #5 which contains 1,000,000 input lines is now taking too long. Go figure! Continue reading “The Full Counting Sort – Issue resolved”

The Number of Full Rounds You Have Played

In a previous post I mentioned that I was planning on an elective surgery on my left knee. Due to the COVID-19 pandemic I had to postpone the procedure. Finally I had it done about three months ago. The procedure took about an hour but no matter how much I have done to get back to pre surgery, I feel I am about 95% there but there are a few things that are not there yet. Next week it will officially be three months since surgery so I am hopping to be 98% to 99% healed.

I have mentioned that I might switch to C++ for a while. Based on the progress on a set of books that I am reading, I might switch to Python for a couple months and then to C++. Continue reading “The Number of Full Rounds You Have Played”

Largest Odd Number in String

Good day! Hope your day has started on the right note. The weather has been behaving somewhat strange this season. We started with very hot days and little precipitation. Such conditions caused many patches of dry grass to appear on lawns all over the Twin Cities of Minneapolis and St. Paul. In the past few days it has been raining on and off. That has helped lawns. I checked the weather forecast for today and my wife and I were planning on having breakfast and then head out for a walk. The forecast was off. We had precipitation for the first few hours, so after breakfast I showered, got dressed and went down to my home office.

In a previous post I mentioned that I was going to participate in a weekly programming contest. The contest was scheduled for last Saturday. When I woke up we had rain and thunderstorms. In the past decade or so I have lost two KVM switches. After replacing the second switch I decided to shutdown all my computers when there is a thunderstorm in the area. I canceled my participation in the contest. Will check if there is one this weekend. Will let you know my findings. Continue reading “Largest Odd Number in String”

Divisor Game

It is Thursday and the workweek is almost done. Continue to walk with my wife every morning unless it is raining. Today it was 75F and 75% relative humidity. The conditions were not the best, but we completed our walk. On my way back I watered the plants. It takes me less than 5 minutes.

The lawns in the neighborhood have patches of dried grass. Most lawns have sprinklers but between the heat and the lack of rain, I would venture to say that about 15% of the grass in most (never say all) laws is yellowish indicating it is very dry.

The saga with the presidential elections in Peru continues. Contrary to what the news from American sources (i.e., Reuters, The Guardian, and The New York Times) state, there has been massive fraud and it seems that the communist candidate will win using fraud. Have we seen this before? Continue reading “Divisor Game”