Remove Duplicates from Sorted Array in Java

Good day. Hope you are doing well. Seems like many companies, businesses and schools are starting to plan on how to conduct business after the COVID-19 pandemic in the USA. It seems like we are getting closer to be able to return to a new normal. I believe that use of masks in public will be required until we achieve herd immunity in different locations. Hope the same is happening in your neck of the woods. Continue reading “Remove Duplicates from Sorted Array in Java”

Print Words Vertically

It is shortly after 05:00 AM in the Twin Cities of Minneapolis and St. Paul. The temperature is just under 32F. It should go up a few degrees as the day progresses. In reality I am at 68F in my office and not planning on leaving the house today.

I mentioned in a previous post that I had ordered from Amazon three books which would be delivered today Tuesday. The first arrived last Sunday, the second arrived yesterday Monday and just before going to bed I noticed a message from Amazon indicating that I should reorder the third book from a different reseller. One of the books was delivered at my home the second must have been dropped in my mailbox. Will check it at lunch time (after what I said, I guess I will leave the house for a few minutes), and I believe I have to look for the third book again. Continue reading “Print Words Vertically”

Dot Product of Two Sparse Vectors in Java

It is Thursday and for a while it was snowing. We received a couple inches of fresh snow. Will see what the weather brings us this weekend. I believe Sunday is going to be the coldest day of this winter so far. We might hit -20F. That said; it appears that the weather forecast changes multiple times a day.

Today my wife was not at home for lunch. I prepare toasts with avocado. Put a dab of butter on a couple slices of ciabatta bread, place them on a cooking sheet and into the oven (set at 400F) they went for about seven minutes. While that was going on, I took out from the freezer a Butter Chicken with Basmati rice tray from Trader Joe’s. As soon as the toast was done I swapped the tray with the chicken. The instructions called for 25 minutes so I consumed the toast with avocado and went back to my office. Continue reading “Dot Product of Two Sparse Vectors in Java”

Design HashMap – Second approach

Today is Christmas Eve Day 2020 and we woke up with -3 F. In addition snow and wind started yesterday afternoon. Looks like a perfect day to stay in and roast a turkey.

As a matter of fact, my wife and I prepared the turkey early this morning and put it in the oven. The raw turkey came in at 24 lbs. It had giblets and a bag of liquid for basting. We disposed of those items. Next time we roast a turkey will get a smaller one (about 11 lbs.) and from a different brand (not Jennie-O). The breast of this turkey is not in proportion to the weight. Will see how the sandwiches on ciabatta bread turned out later this afternoon. Continue reading “Design HashMap – Second approach”

Spiral Matrix – Revisited

Good morning. Hope your day is starting on the right note. Yesterday was a long and busy day. Something at work stated on Saturday extended at least through yesterday. I spent a lot of time on the phone, browsing code and looking at log files. It seems we know what is causing the problem. Currently I am in the midst of formulating approaches to address the issue. Hopefully all will be solved by tomorrow.

On a separate note, yesterday I had the opportunity to meet on-line a software engineer that works at a large software company. You never know what the future has reserved for you. Continue reading “Spiral Matrix – Revisited”

Reverse Operations

In the past three days the high for the day has been in the mid to upper 40s. Since late fall a considerable amount of leaves has been accumulating in the entrance at home. Yesterday just before lunch I picked up the dead leaves. This morning some started to collect. I guess this is due to the orientation and shape of the entrance.

Last evening I also read an interesting article titled After Centuries, a Seemingly Simple Math Problem Gets an Exact Solution by Steve Nadis published in Quanta Magazine. Apparently a German mathematician named Ingo Ullisch figured out an exact solution for a problem. Good for him. What I liked more than the problem or its solution is the last paragraph in the article. In my humble opinion, this reaffirms the fact that reading and experimenting is the best way to learn. Continue reading “Reverse Operations”

Sherlock and GCD

It is a Monday morning and it is garbage collection day so I had to put out on the driveway both bins. The company that provides our development with the service collects every week both garbage and recycle bins. All previous companies that I am familiar with collect garbage every week and recycle every other week. To be honest with you, my wife and I would be fine with recycling once a month and if it was not for the potential for smell during summer, garbage every other week.

Earlier this morning, I saw in my inbox a recommendation for a problem from HackerRank named Sherlock and GCD which maybe solved with a Dynamic Programming approach. Continue reading “Sherlock and GCD”

Number of Visible Nodes

Good day! Hope you are doing well. Apparently the number of COVID-19 cases in the Twin Cities of Minneapolis and St. Paul has risen. In addition it seems that the number of free ICU beds had dropped closely to 0. This implies that a person who falls sick and needs intensive care might have a tough time finding an available bed. For our own sake, please follow distancing rules and keep safe. We all will benefit from such behavior.

I have been looking at some problems in a Facebook portal. They are intended as exercises for technical interviews. Continue reading “Number of Visible Nodes”

Angle Between Hands of a Clock – Java

It is Tuesday November 03, 2020 and it is Election Day. As it is customary my wife and I got up at 06:00 AM. I prepared our usual breakfast (yogurt, mixed fruits, homemade granola and bananas). We have been preparing the same breakfast for a decade or so.

After breakfast, we both got ready and headed to our designated polling location. There were two lines. Both were moving at a reasonable rate. Once we got our ballots we filled them and inserted in the counting machine. We were at the site for about 15 minutes. All went as expected. Continue reading “Angle Between Hands of a Clock – Java”

Binary Search Tree to Greater Sum Tree – Java

Hello there. It is another Sunday morning during the COVID-19 pandemic. The current temperature in the Twin Cities of Minneapolis and St. Paul is about 30F and is sunny. As soon as I finish with this post my wife and I will stop by Target to get some sundries.

Yesterday my wife and I met my older son at Costco in Minneapolis. We get together every other weekend at Costco to do groceries. My wife and I got a 35 lbs. of beef chuck cut. Once we got home we cut smaller manageable portions, put them in bags and placed them in the freezer. We left one portion out. We cut it into smaller pieces, cut some potatoes, onions, garlic and carrots. Put them in a tray in a 550 degree oven for 10 minutes. The beef browned quite nicely. We then put the items in a pressure cook with some water and left them cooking for 1 ½ hours. We served them in on a thin base of very hot brown rice. I had two large servings. It was delicious. Continue reading “Binary Search Tree to Greater Sum Tree – Java”