Coin Change 2

Went after the LeetCode challenge Coin Change 2 which you can find at the following URL:  https://leetcode.com/problems/coin-change-2/?tab=Description

There are two approaches typically used to solve this type of problem. They are:

Recursion
Dynamic Programming

I consider dynamic programming more of an art than a science. I believe developers need to use it often enough to solve adequate problems to achieve and maintain proficiency in the technique.

I visited the Wikipedia page on Dynamic Programming and took notes which I present in the following couple paragraphs. That is simpler and quicker than starting from scratch ;o) Continue reading “Coin Change 2”

Longest Absolute Path File – Solved

I looked at the following LeetCode challenge:  https://leetcode.com/problems/longest-absolute-file-path/?tab=Description

Typically I write my test code using the Scanner class. Initially this time was no exception. I did notice that the input contained the strings “\n” and “\t” but I just went ahead. Processing of input created some side effects which I documented in a previous post with this same title. The approach which I will start using from now on was to place the input in an array of Strings and traverse it. This is illustrated in the following Java test code: Continue reading “Longest Absolute Path File – Solved”

Cavity Map

Based on an email message from HackerRank I decided to accept the Cavity Map challenge. The description for the challenge may be found using the following URL:  https://www.hackerrank.com/challenges/cavity-map?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=3-day-campaign

As usual, if interested please read the description and give it a try.

The Need Help link on the page discusses string basics. In this case I did not find the help of use. Continue reading “Cavity Map”