I enjoy doing code exercises in my spare time. Below are some of my solutions that I have written in C, C++ or C# for the exercises provided from three sources: Codility, HackerRank and Gayle Laakmann McDowell’s book “Cracking the Coding Interview“.
All solutions scored 100% unless explicitly indicated otherwise. On occasion I will upload poorer scoring solutions as part of my discussion, and describe how the solutions can be optimised.
You can click on the links to my solutions below. They are organised according to Codility lesson.
Stacks and queues
Cracking the code interview
Anagrams (Sorting and searching)
Merge Sorted Arrays (Sorting and searching)
Magic Index (Recursion and Dynamic Programming)
Permutations (Recursion and Dynamic Programming)
Powerset (Recursion and Dynamic Programming)
Invert Binary Tree
Between Two Sets (Easy)
Data Structures and Algorithms Bootcamp (Udemy)
UniqueCharacters (Common interview questions)
IsPermutation (Common interview questions)
OneAway (Common interview questions)