Single Number II
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using e...
class="markdown_views prism-kimbie-light">
单变元模线性方程
目标 :
已知 a, b, n 求x
使得 ax ≡ b(mod n)
令 d = gcd(a,n)
先使用扩展欧几里得求 ax + ny = d 的解,如果 b 不能整除 d 则无解,否则 mod n 意义下的解有d 个,可以对...
一般写法:for (var i = 0, len = rows.length; i < len; i++) { if (i % 2) { className = "even"; } else { className = "odd"; } // apply class}小改进后的写法:for (var i = 0, len = rows.length; i < len; i++) { if (i & 1) { c...