JetBrains academy – Kotlin – this one was tough ;)

So, I eventually stepped on Seam Carving in JetBrains Academy - Kotlin. This one was tough ;) And, to be honest, mostly due to my ignorance. As I had Algorithms and Data Structures lecture during my studies – to be honest, I have been teaching Algorithms and Data Structures in C++ for one semester at the university. But still, I have approached this topics with over optimistic assumption – “- Easy-peasy, I know how to do it straight away” ;) I didn’t! I simply completely forgotten famous Dijkstra’s shortest path algorithm. Now I can definitely confirm (based on my judgement and experience) that not used concepts fade away, and pretending that we know what we did know is just lying to yourself :)

Anyways, with help of Algorithms, fourth edition by Robert Sedgewick (btw, I suggest to get the copy of this one if you work with Java related technologies) I have eventually solved the task.

However, it wasn’t all the time sunshine and roses :) I simply had to sit down, make some drawings related to the problem and spend some time on it. Still, I think it was really nice problem to solve. Even more, I think it’s worth trying to solve it as it is a part of curriculum of various Computer Science related courses.

And, finally, here comes the application of seam carving to image reduction