SnailShell

Tags/#algorithm

A Constant Solution to Code-Fights Apple Boxes Problem

The Apple Boxes Problem The problem can be simply put: Input: $k$ Output: let $r$ be the sum of the square of each even integer no larger than $k$, and $y$ be that of the odd.

Count 1s in Range

在 codefights 上做到了一个很有意思的题。给你 a, b 两

Valid Number - By DFA

Introduction to the Problem The question asks the programmer to validate whether a string is a valid representation of a number.