Skip to content

artemponomarevjetski/python-codility-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python_codility_solutions_artem_ponomarev

#Task descriptions are given on Codility website, https://app.codility.com/programmers/

Hello fellow data scietists! This repo is my attempt to scale the Codility test for job interviews. Even if your employer does not ask you to take this test, it is a good mental practice to solve a Codility problem once in a while. My language of choice is Python. However, Codility problems seem to be more of a logical puzzle, than a programming language test. You cannot import Python libraries, like pandas, in Codility IDE. All syntax has to be quite basic. The most difficult part is to make your algorithm 'efficient'. That is, it has to be either O(1), or O(n), or at worst O(n*log(n)), where n=len(A); A is the suggested input. The trick is to make the code as minimalist as possible. Avoid nested loops, objects that hold unnecessary information, and try to exit the execution as quickly as possible, using 'return' and 'break' statements, while keeping the result correct, of course.

Another diffuculty is 'edge' cases. Say, your algo gives the right result for a nice looking and short input. What about extreme cases: null input, one element in A, maybe 2 or 3 elements that are still a special case, large numbers, repeating numbers, drastically different numbers, long inputs, random inputs, inputs with a strange pattern. Or what have you...

Use the user-supplied input to test 'edge' cases.

Getting a correct answer for the default input is where the real game starts. Keep your reasoning skills sharp...

-python-codility-solutions-artemp

About

Time complexity optimization in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published