Student Attendance Record I

Woke up today at 04:20 AM. It was raining. Spent some time reading and on this blog and at 06:00 time to make the donuts (actually breakfast).

Since I had not much time I did a search on LeetCode problems using the string “recursion”. Problem 551. Student Attendance Record I came up. I did not see the need to use recursion and the problem does not specify to use it either. Continue reading “Student Attendance Record I”

Rectangle Overlap

There is some severe weather in the Texas area which should affect the Twin Cities of Minneapolis and St. Paul later today and tomorrow morning. Hopefully it will not be too bad.

On the local news members of the Black Lives Matter movement vandalized and looted several blocks of tall buildings in the down town of the Minneapolis business area. Not sure what was the point of the protests which just create problems for regular people that work and live in that area of the Twin Cities. This time around, the mayor of Minneapolis and the governor of Minnesota immediately called for the Minneapolis police, Minnesota State troopers, and National Guard to stop the vandals and looters. Will see how this sage develops in the next few days. Continue reading “Rectangle Overlap”

Get Returned Type – Java

In general when you are developing software you need to have a good idea of the different classes that are needed and for each class the members and methods. Under some special circumstances you might run into classes that are not documented and you need to get some information as to the returned values. Please bear with me attempting to provide a good example. In practice most of the time (do not generalize) you will have such information displayed in your IDE or in documentation provided by the vendor. Continue reading “Get Returned Type – Java”

Reverse Linked List

In this post I will reverse a linked list in Java. As I mentioned in a previous post, I am in the process of refreshing recursion using Java. In the next few days I will pick up a few more problems and post my approach.

In this post I will deal with 206. Reverse Linked List. If interested please take a look at the requirements for the problem and then give it a try before looking at solutions. Continue reading “Reverse Linked List”

Number of Recent Calls

It is an ugly rainy and stormy day in the Twin Cities of Minneapolis and St. Paul.  It seems like the storms will resume around 03:00 PM later today. In general I shutdown all my desktop computers when there are thunderstorms. I have a couple UPS units but I have also invested time installing software and configuring them exactly the way I like it. Do not wish to change disks or re install software.

Earlier today I opened the LeetCode web site and selected the problems icon. In the search box I entered the word “recursion”. Many problems were listed. I sorted them by difficulty Easy to Difficult. I then selected problem 933. Number of Recent Calls. Time permitting, decided to tackle three problems in the three categories in the next few days. Continue reading “Number of Recent Calls”

Longest Univalue Path

I have a childhood best friend which we both attended K-12 in the same sequence of schools. We used to hang out on weekends and in some occasions would go out with the family. After high school we both went in different directions. We lost track of each other while attending college. A few years went by and we reconnected. Since then we have visited in person and our spouses appear to have connected well.

Through the years we kept in touch about once a month via Skype. Since the COVID-19 pandemic started, we talk once a week, typically on Friday. We are both morning people so we set the call time between 06:00 AM and 07:00 AM. This morning around 05:00 AM I received a message via Gmail that he had some work appointments early morning. We skipped the call but will reconnect next week. Continue reading “Longest Univalue Path”

Lowest Common Ancestor of a Binary Tree

Things might be getting somewhat more complex with the COVID-19 pandemic that started in Wuhan, China. The CDC has been posting articles stating that individuals, who have recovered from COVID-19, may be prone to reinfection after three months. The theory of herd immunity, without a vaccine, goes out the door.

On a side note, people in the city of Wuhan, China have been celebrating that coronavirus is receding (there is no way to find out with data what is actually happening there) in their city with a massive water park party. The Chinese Communist Party does not seem to accept responsibility for the 800,000 deaths globally which they allowed to happen and are taking advantage of it in different ways. Continue reading “Lowest Common Ancestor of a Binary Tree”

Lowest Common Ancestor in Binary Search Tree

It is a beautiful sunny summer day in the Twin Cities of Minneapolis and St. Paul. The high temperature for today in the city I live is forecasted to be 83 F. I prefer high temperatures in the range of 75 F to 80 F, but 83 F will have to do.

Yesterday I spent a few hours in front of my computers. My wife left early with a friend to go walking and shopping. My wife got back shortly after 11:00 AM. We made some potatoes with veggies in the grill using a cast iron pan. We always add some pepper, salt and a splash of oil with a high smoke point (i.e., avocado or peanut). Continue reading “Lowest Common Ancestor in Binary Search Tree”

Greatest Common Denominator

Last weekend my wife and I visited our son and family who live in Madison, Wisconsin. They like to cook and bake like we do. When I was growing up, most summer days I would make ice cream. The techniques and ingredients were quite simple.

Over the weekend my son made ice cream. He did it using the ice cream bowl for the Kitchenaid mixer. It happens that we also have an ice cream bowl. When we got back, we decided to make some ice cream using the same recipe that our son had used. We searched for our ice cream bowl which we have not used in years, but were not able to find it. We decided to use a regular bowl and the standard 6-wire whip attachment. Continue reading “Greatest Common Denominator”

Sum Two

This weekend my wife and I spent it in Madison, Wisconsin visiting our son and family. We left Friday after work and returned Sunday afternoon. The drive is between 3.5 and 4.0 hours depending on traffic. Given that we are in the middle of the COVID-19 pandemic, we were amazed at how much traffic we encountered.

Last Friday morning I took a look into a couple problems but did not have time to write the associated posts. I will do if I have some time in the near future. Note that I have already addressed a similar problem in my post Sum of Two earlier this year.

In this post I will cover a problem I searched for on the web. This problem comes in different flavors. I found the one on LeetCode so I decided to take a stab at it. Continue reading “Sum Two”