Solution to Next Permutation by LeetCode

28 Apr

Question: http://oj.leetcode.com/problems/next-permutation/ Question Name: Next Permutation This problem seems like a mathematic question, rather than a programming challenge.

Solution to Implement strStr() by LeetCode

25 Apr

Question: http://oj.leetcode.com/problems/implement-strstr/ Question Name: Implement strStr() The KMP is a much better solution. But as long as brute force passed all tests, let’s use brute force.

Solution to Divide Two Integers by LeetCode

24 Apr

Question: http://oj.leetcode.com/problems/divide-two-integers/ Question Name: Divide Two Integers

Solution to Remove Duplicates from Sorted Array by LeetCode

24 Apr

Question: http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/ Question Name: Remove Duplicates from Sorted Array

Solution to Remove Element by LeetCode

24 Apr

Question: http://oj.leetcode.com/problems/remove-element/ Question Name: Remove Element

Solution to Reverse Nodes in k-Group by LeetCode

24 Apr

Question: http://oj.leetcode.com/problems/reverse-nodes-in-k-group/ Question Name: Reverse Nodes in k-Group

Solution to Count-Distinct-Slices by codility

17 Apr

Question: https://codility.com/demo/take-sample-test/count_distinct_slices Question Name: Count-Distinct-Slices or CountDistinctSlices

Solution to Count-Triangles by codility

17 Apr

Question: https://codility.com/demo/take-sample-test/count_triangles Question Name: Count-Triangles or CountTriangles This problem is nearly the same as the exercise in presentation of lesson 13. Update on May 24, 2014: Thanks to @Adam. Fix a bug, which lower the performance.