Category: algorithms
I wrote a Chinese Chess freeware in 2005 (ten years) ago (as the bachelor final year project). The project was initially written and compiled under Delphi 7. Later I …
Count the number of prime numbers less than a non-negative number, n. Submit your solution to: https://leetcode.com/problems/count-primes/ Naive Solution The first solution is straightforward, a prime number is a …
Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, …
Background I was asked by my manager to optimize a piece of code that has been in the code repository for like 4 years. Actually, that particular piece of …
If you want to solve the following puzzle then it may be not so easy/intuitive at a glance. It is a square and 20 is the area with e.g. …