Solution to Codility lesson1-exercise3 Permutation Missing Element problem, link to Codility problem and complete solution at the end of the post. Definitions: Problem: Define a function solution with input A, such that solution returns the missing element of the sequence . Expected worst-case time complexity is O(N); Expected worst-case space complexity is O(1), beyond input […]

# Time Complexity

# Codility - Frog Jump

Solution to Codility lesson1-exercise2 Frog Jump problem, link to Codility problem and complete solution at the end of the post. Definitions: Problem: Define a function solution with input X, Y, D, such that solution returns the minimum number of jumps needed to reach a position equal or greater than Y from position X, being D the […]

# Codility - Tape Equilibrium

Solution to Codility lesson1-exercise1 Tape Equilibrium problem, link to Codility problem and complete solution at the end of the post. Definitions: So, taking P we split the elements of A in two sets . We will define a binary operation diff such that the result of this operation will be, Problem: Define a function solution with […]