ALGOHAY
Time complexity