How to calculate Big O notation from piece of code
stackoverflow.com