Category: Easy Problems
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 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 …
The Triangle problem is solved once we realize that 3 elements in an array are triplets, then they are somehow close as value (proportionally to how big they are …
Ok, the Distinct Codility challenge is an easy one and it can be solved in a number of ways. I went for something fun since we do Javascript, so …