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:
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”
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”
This challenge from LeetCode may be found at the following URL: https://leetcode.com/problems/summary-ranges/?tab=Description
If interested, following is a screen capture from my Eclipse IDE:
>>> N: 6 <== number of numbers that follows
0 1 2 4 5 7 <== sorted numbers
summary: [0->2, 4->5, 7] Continue reading “Summary Ranges”
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”