The next thing we can optimize is the fact that the result of the powers calculation does not change during the same length of the numbers. In order words, 3 ** 3 does not change for the numbers 123, 345, 543 and any other number containing a 3 in the range of 100 – 999.
The first improvement we will make is to move away from int to string to int conversion in the previous code and implement integer only operations. We can do this by using the modulo and floor integer division.
This first part will deal with setting up the problem and the first initial code.
Problem
The problem to solve is to find the first x amount of Narcissistic Numbers . What they are is easy to explain. The process by which to identify if a number is narcissistic is by following these steps:
This is a brief post on a phenomenon that is easy to detect but hard to combat and even harder to eradicate. The following happens more often than not, sadly. So you are in a discussion with a colleague on what kind of tech to use and it actually got started by the other colleague saying we should use this technology. We shall call the technology Starlit Snowflakes. I hope you learned by now the first and only relevant question to ask that needs a satisfying answer is of course:
No I have not caved and suddenly love Kubernetes. Also this is probably the best topic so far that has given me so many things to write about so I hope you will allow me to milk it a little more.
I am not happy with Kubernetes. No, that is too soft but hating Kubernetes is too strong. It is one below hate. I dislike working with it and I advise others to take caution in wanting to use it.
As I stand in a hot grimey late afternoon sun waiting for a delayed train I am suddenly wondering what it is people see when they look at me. What is it that they perceive with their frames of reference.
So in the previous post I showed how to use the pattern of Suppliers and Consumers to structure any kind of input and output of data and structuring the processing. Well for bonus points we are going to make something fancy, a Chain. A Chain is nothing more than the series of steps that starts with one action and the result of that action will be the input for the next action and so on all the way till the end. Let us make one.