The practicing of the Codility Lesson 11 ~ 15 with C++

Jen-Hsuan Hsieh (Sean)
A Layman
Published in
12 min readAug 4, 2019

--

Sieve of Eratosthenes, Euclidean algorithm, Fibonacci numbers, Binary search algorithm, and Caterpillar method

Introduction

It’s indispensable for software engineers to improve their algorithm concept before interviewing. For most of the famous companies, the first staging for the candidates is an online test invitation. You will be allowed to join the next stage if you pass the test.

The tests from Codility or Leetcode usually focus on correctness and performance. Try to explore the best solution, not only solve the problems when you practice it.

This’s my note. It covers the lesson from 11 to 15.

  • Lesson 11 Sieve of Eratosthenes: CountSemiprimes, CountNonDivisible
  • Lesson 12 Euclidean algorithm: ChocolatesByNumbers, CommonPrimeDivisors
  • Lesson 13 Fibonacci numbers: Ladder, FibFrog
  • Lesson 14 Binary search algorithm: MinMaxDivision, NailingPlanks
  • Lesson 15 Caterpillar method:CountDistinctSlices, CountTriangles, AbsDistinct, MinAbsSumOfTwo

The following figure shows the grades. There are still some questions I have to improve in the future.

--

--

Jen-Hsuan Hsieh (Sean)
A Layman

Frontend Developer🚀 Angular • React • Nest • Electron • Micro-frontend • Monorepo Architecture • https://daily-learning.herokuapp.com/