by Xiaokang Zhang | Jan 30, 2017 | Economics

工作之后，我们所切身关心的问题包括： 我们交了多少税？我们为什么要交这么多税？我们怎样才能少交税？ 这篇文章里，我想要重点讨论第二个问题：我们为什么要交这么多税？ 我们知道，为了维持公共机构和公共服务的运转，税收是必不可少的，“税收是我们为文明社会付出的代价”。根据社会契约的思想，每个人让渡出一部分的个人权利来组成一个政府，从而保护自己的财产等权利，税收可以视作是这让渡出的一部分权利。那么如何确定每个人应该缴纳税款的量呢？怎么样的税收制度才是有效率的？ 税收的效率...
by Xiaokang Zhang | Jan 24, 2017 | Algorithm & Data Structure

Sliding Window Sliding window is a common approach in solving algorithm problems, it has a few elements: Window start and endStatus of elements in the windowWindow extends to the right according to the statusWindow shrinks to the right according to the statusWindow...
by Xiaokang Zhang | Jan 24, 2017 | Algorithm & Data Structure

Maximum Size subarray problem Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn’t one, return 0 instead. Note:The sum of the entire nums array is guaranteed to fit within the 32-bit signed integer range....
by Xiaokang Zhang | Jan 23, 2017 | Algorithm & Data Structure

Maximum Product Subarray Problem Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest product = 6. Reduction Transition...
by Xiaokang Zhang | Jan 23, 2017 | Algorithm & Data Structure

Maximum Subarray Problem Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] has the largest sum = 6. Reduction Transition...