Encrypted Words

Today is Friday. The current temperature is about 40 F which is not bad for this time of the year. Tomorrow is my youngest sister birthday. I believe she is still in China. I will send her a message wishing her a nice day.

I have a few problems solve from a Facebook coding practice questions site. I should post them over the weekend if something else does not come up. My wife and I are planning on getting groceries done at the end of the day so we can remain at home over the weekend. Grocery stores tend to have much more activity on weekends. Continue reading “Encrypted Words”

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”

Maximum Subarray Sum – Kadane’s Algorithm

A day or two ago I was browsing Reddit.com and saw a question regarding finding the maximum sum of a sub array given an array of integers. I decided to do some exploration on the Kadane’s algorithm. I tried a couple brute force implementations. I then went for an implementation using the algorithm.

Maximum Subarray Sum

Given an integer arry nums, find the contiguous subarray (containing 
at least one number) which has the largest sum and return its sum.

The problem definition is quite simple. Implementing a brute force is not too bad but it is quite slow. After a couple implementations we will use Kadane’s algorithm in the third approach. Continue reading “Maximum Subarray Sum – Kadane’s Algorithm”