摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2017-04-27 11:01 sunli0205 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1 public static void main(String[] args) { 2 char[] s ={'3', '2', '3', '^', '3','^', '1'}; 3 eatgold(s); 4 } 5 6 private static void eatgold(char[] value) { 7 ... 阅读全文
posted @ 2017-04-27 10:43 sunli0205 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 一个字符串中有多个个回文字符串: 阅读全文
posted @ 2017-03-24 09:24 sunli0205 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] 阅读全文
posted @ 2017-03-23 21:36 sunli0205 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 顺序栈: 定义一个接口:IStack<E> 定义一个SeqStack<E>类实现栈的抽象数据类型类 主函数实现 阅读全文
posted @ 2017-03-21 15:44 sunli0205 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of 阅读全文
posted @ 2017-02-22 20:07 sunli0205 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 1、左移( << ) // 0000 0000 0000 0000 0000 0000 0000 0101 然后左移2位后,低位补0:// // 0000 0000 0000 0000 0000 0000 0001 0100 换算成10进制为20 System.out.println(5 << 2) 阅读全文
posted @ 2017-02-22 10:06 sunli0205 阅读(191) 评论(0) 推荐(0) 编辑
摘要: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2017-02-22 10:00 sunli0205 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Example 1: Exa 阅读全文
posted @ 2017-02-21 09:53 sunli0205 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 为什么要了解浏览器加载、解析、渲染这个过程? 1.了解浏览器加载,可以在引用外部样式文件,外部js时,将他们放到合适的位置,使浏览器以最快的速度将文件加载完毕 2.了解浏览器解析,可以在构建DOM结构,组织css选择器时,选择最优的写法,提高浏览器的解析速率。 3.了解浏览器渲染,明白渲染的过程,我 阅读全文
posted @ 2017-02-20 21:07 sunli0205 阅读(614) 评论(0) 推荐(0) 编辑