Solution to Odd-Occurrences-In-Array by codility

18 Sep

Question: https://codility.com/programmers/task/odd_occurrences_in_array Question Name: Odd-Occurrences-In-Array or OddOccurrencesInArray This question is completely the same as the Perm-Missing-Elem by codility. The comment from Kim is very helpful.

Solution to Number-Solitaire by codility

6 Sep

Question: https://codility.com/demo/take-sample-test/number_solitaire/ Question Name: Number-Solitaire or NumberSolitaire The key point is: to achieve the position i, we can only come from the positions i-6, i-5, i-4, i-3, i-2, and i-1.

Solution to Reverse Linked List by LeetCode

3 Sep

Question: https://leetcode.com/problems/reverse-linked-list/ Question Name: Reverse Linked List

Solution to Isomorphic Strings by LeetCode

1 Sep

Question: https://leetcode.com/problems/isomorphic-strings/ Question Name: Isomorphic Strings The key point is to avoid 2+ characters map to the same character.

Solution to Count Primes by LeetCode

29 Aug

Question: https://leetcode.com/problems/count-primes/ Question Name: Count Primes

Solution to Remove Linked List Elements by LeetCode

29 Aug

Question: https://leetcode.com/problems/remove-linked-list-elements/ Question Name: Remove Linked List Elements

Solution to Happy Number by LeetCode

29 Aug

Question: https://leetcode.com/problems/happy-number/ Question Name: Happy Number

Solution to Number of Islands by LeetCode

31 Jul

Question: https://leetcode.com/problems/number-of-islands/ Question Name: Number of Islands A variant of weighted quick union.