Two Sum – Revisited

It is a very nice sunny day in the Twin Cities of Minneapolis and St. Paul. Today is March 29, 2021 and the high for the day is going to be around 70F. My wife and I talked about grilling chicken for lunch but it is a work day and the process of grilling, eating and cleaning might take a couple hours. That is fine on a holiday.

I decided to attempt to solve all problems in a section of LeetCode. It seems that several problems that I have solved before fall into this collection. I will take a problem from each category a day. Perhaps on weekends I will look at two. Continue reading “Two Sum – Revisited”

Inorder Successor in BST

As you might know, I work on 2-hour blocks. At the end of a block I go upstairs and get something to drink. I chat with my wife for a few minutes and then head downstairs to my office for the next 2-hour block. I just got back and was about to start a new task when I noticed that I had not finished a post I started earlier today. Will finish it right now and will post it. Then I will move on to the next task.

This morning we woke up to a balmy 11 F degrees. The good thing about the COVID-19 pandemic is that we can work from home and do not have to deal with the car and parking. I fully understand that is nothing to what other people are going through. Hopefully we will be getting a vaccine in the next few months. If all goes well we might start going back to something that resembles how things were before the pandemic. Continue reading “Inorder Successor in BST”

Add Strings

Good day! My wife and I had a good weekend. Hopefully you did also.

As I was generating this post I noticed that my blog has passed the 5,000 subscribers!!! Thanks to all of you. If you have suggestions on how to improve, I would be interested in learning your thoughts. Once again; thanks to all of you.

Over the weekend my wife and I prepared Oxtail Stew. It was very yummy! We coated the oxtail parts with some olive oil. On a baking tray we placed the pieces. We put them in an oven at 550F. As soon as the pieces started to get cooked, we flipped them and put them back in the oven to repeat the process. We were looking for nice color all around.

While in the oven we chopped onions, celery and some carrots to make our mirepoix. We did not add oil, salt, pepper or any other condiments.

We took the oxtail, the mirepoix and a couple cups of chicken broth and put them in an electric pressure cooker for 90 minutes. Oxtail contains a lot of fat , which like many other things in life, it is good with moderation, so it is better to let it melt away and when done, remove most of it. Continue reading “Add Strings”

Best Time to Buy and Sell Stock – Java

It is Sunday morning on a gloomy and cold day in fall in the Twin Cities of Minneapolis and St. Paul.

Last evening my wife and I watched Peppermint on Netflix. We both like most of the movies with Jennifer Garner. The ending of the movie could be somewhat debatable. In a nutshell, the husband and daughter in the movie are murdered by a drug dealer. They did not happen to be a casualty, they were all targeted. The core of the movie is based on what the surviving mother does to get justice for what happened. Towards the end of the movie she completes her tasks. Then the part that might be debatable is shown. I am not going to spoil the ending in case you are interested in watching the film.  My wife and I liked what transpired in the last couple minutes of the movie. Continue reading “Best Time to Buy and Sell Stock – Java”

Validate Binary Search Tree

It is a gloomy day in the Twin Cities of Minneapolis and St. Paul. The good thing is that we have about two days until Thanksgiving Day 2020. This year we are cooking an 11 lbs. turkey. Typically my wife and I make an 18+ lbs. bird. Not only that but we are dropping half of it at our granddaughters place. On Thanksgiving Day we will be connecting with family via Jitsi and Skype. Continue reading “Validate Binary Search Tree”

Print Immutable Linked List in Reverse

Hi gals and guys. Hope you are doing well during the COVID-19 pandemic. It seems that most of us are somewhat tired following the basic rules that reduce the spread of the coronavirus. By relaxing the rules in the past few months, the numbers of COVID-19 infections, in most cities worldwide, are going up. Note that the issue is the number of infections, not the number of deaths. Infected people may need hospital services. If the number of patients is larger than the capacity like it was when this thing started, then we have a problem. At this point in time, people with most infections per 1,000, is people in college age. Please follow the rules! We all benefit from it. Continue reading “Print Immutable Linked List in Reverse”

Reverse Only Letters

Definitely the weather is changing in the Twin Cities of Minneapolis and St. Paul. Last night my wife and I slept with a windows in the kitchen opened just a crack. This morning the upstairs temperature was at 69F. During winter we keep the upstairs at 68F. Chances are that this evening will sleep with the windows closed and the heater on.

I need to update my post previous post Count Negative Numbers in a Sorted Matrix. I made an incorrect statement and would like to generate an update. If you are curios, I left the body of the post as it was. I generated an opening note. Continue reading “Reverse Only Letters”

Merge Two Binary Trees – Java

It is Monday morning. I got up earlier to finish the code and this post. Hope to be done before 06:00 AM. Today is my wife’s birthday. She is an evening person. Every morning I get up, fix breakfast, and then wake her up.

This year due to the COVID-19 pandemic (thanks China) we have not planned a celebration. Dates tend to shift by a day on non-leap years. Yesterday I received a message with Google photos that we took on yesterday’s date several years ago. Last year for her birthday we were with some family, friends in Rome, Italy. In the evening we all had a nice dinner and walked to the Fontana di Trevi and tossed three coins. That was a nice way to close the day. We like Italy and have been there many times. Perhaps next year things will be back to the new normal and will be able to celebrate once again in Rome. Continue reading “Merge Two Binary Trees – Java”

Minimum Distance Between BST Nodes

Earlier today I read the article “Changing the clocks is a bad idea — and it should end, sleep experts say” by Jen Smith, CNN. The article makes a case for the USA to eliminate daylight savings time. It seems there is enough science behind the idea.

I am a morning person. I have a wake up alarm in my smart phone to wake up at 06:00 AM every day. Most of the time I get up about an hour early. Of course, in the evenings my wife and I are ready to hit the sack around 08:00 PM. At the start of summer the sun is up before 06:00 AM. At the start of winter, it is dark around 04:30 PM. Continue reading “Minimum Distance Between BST Nodes”