Category: Algorithms
Below you can find my 100% solution to one of the Codility Lesson 6 practice challenges. The complexity of my solution is O(n) and passed all scores with 100%. …
The Min Perimeter Rectangle challenge brings us back to a lot of math. I had a gut feeling on this one and I only checked with a few examples …
The Max Profit Codility challenge put me to a solid test in order to find a O(N) solution. In the end I found the following algorithm: I iterated the …
The Max Double Slice Sum was a challenging problem to solve in O(N) complexity. I iterated through the array from both sides finding out at each position the maximum …
The Equi Leader Codility challenge builds on top of the previous Dominator challenge. After we find the leader, we will need to find how many equi leaders there are …
The Dominator Codility Challenge was fun to solve. Its difficulty is marked as easy in Codility and I agree. I used an object to hold the number of occurrences …
The Stone Wall Codility challenge proved more difficult for me than the rating it is attributed (easy). I still think it’s at least a medium level challenge, at least …
The Count Factors challenge is just the classic finding the division factors of a number. The most efficient way I found was iterating until the square root of the …
The Max Slice Sum was a fun brain challenge. I ended up finding the O(N) complexity solution after using the ol’ pen and paper trials. So, I iterated over …
The Brackets challenge from Codility was a fun exercise. A solution with O(N) complexity requires a single run of the array. At each step, we operate on a stack …