摘要: Wiki:Barrier In parallel computing, a barrier is a type of synchronization method. A barrier for a group of threads or processes in the source code me 阅读全文
posted @ 2016-06-20 16:48 小白兔纸白又白 阅读(914) 评论(0) 推荐(0) 编辑
摘要: 方法1: function unique(arr){ var newArray=[]; var hashTable={}; for (var i = 0, item; (item=this[i]) != null; i++){ if(!hashTable[item]){ newArray.push( 阅读全文
posted @ 2016-02-10 22:36 小白兔纸白又白 阅读(153) 评论(0) 推荐(0) 编辑
摘要: https://www.hackerrank.com/challenges/the-minion-game STUART 和KEVIN玩The Minion Game STUART 的得分是以辅音字母开头的,KEVIN是以元音字母开头的,每有一个子字符串便的一分 笨办法是两重循环,内层循环去字符串中 阅读全文
posted @ 2016-02-09 15:18 小白兔纸白又白 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 要求: 1. 字符串中所有的 a 或 b 个数 相同 2. 字符串的任意前缀(从字符串的头开始的子字符串)中 a 和 b 的个数之差不超过1 对于这样的问题,比较好的方法是一上来就写出几种情况来找规律 按要求,开头分为两种情况1) 以 a 开头 2)以 b 开头.这两种情况都是对称的,解决任意一个就 阅读全文
posted @ 2016-02-08 14:47 小白兔纸白又白 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 0x00. 预备知识 异或是逻辑运算符中的一种,基本的定义是:对于两个操作数,如果他们不相同(一个为true,另一个为false)那么输出为true。大多数编程语言都提供这样的操作符(^)。 运算见下表: XOR Truth Table InputOutput AB 0 0 0 0 1 1 1 0 阅读全文
posted @ 2016-02-08 14:35 小白兔纸白又白 阅读(1811) 评论(0) 推荐(0) 编辑