StealthyCoder

Making code ninjas out of everyone

The next mini optimization we can do is to bail out earlier because when summing the number and we overshoot the original then we can stop immediately. For example 9 ** 6 is a big number and so with bigger numbers it makes sense to bail out earlier.

Read more...

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.

Read more...

A small mini optimization is to move the call to len out as the length of the number does not change.

Read more...

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.

Read more...

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:

Read more...

So there are moments in your career where you face a choice: to go or to not go nuclear.

What does it mean to go nuclear though?

Read more...

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:

Read more...

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.

Read 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.

Read more...

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.

Read more...