上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页
摘要: Remove Linked List ElementsRemove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,va... 阅读全文
posted @ 2015-05-01 10:13 陆草纯 阅读(1850) 评论(0) 推荐(0) 编辑
摘要: Happy NumberWrite an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any posi... 阅读全文
posted @ 2015-04-30 21:06 陆草纯 阅读(2837) 评论(0) 推荐(0) 编辑
摘要: Isomorphic StringsGiven two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All... 阅读全文
posted @ 2015-04-29 20:24 陆草纯 阅读(4012) 评论(0) 推荐(0) 编辑
摘要: Bitwise AND of Numbers RangeGiven a range [m, n] where 0 = (int)pow(2.0, i)) && (ind+gap <= (int)pow(2.0, i+1)-1)) //all 1's ... 阅读全文
posted @ 2015-04-17 22:02 陆草纯 阅读(1028) 评论(0) 推荐(0) 编辑
摘要: Repeated DNA SequencesAll DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it i... 阅读全文
posted @ 2015-04-12 22:39 陆草纯 阅读(537) 评论(0) 推荐(0) 编辑
摘要: Number of IslandsGiven a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by con... 阅读全文
posted @ 2015-04-11 22:15 陆草纯 阅读(3487) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Right Side ViewGiven a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered fr... 阅读全文
posted @ 2015-04-11 17:44 陆草纯 阅读(1636) 评论(0) 推荐(0) 编辑
摘要: House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint... 阅读全文
posted @ 2015-04-11 12:55 陆草纯 阅读(8616) 评论(0) 推荐(0) 编辑
摘要: 最好在定义的时候就给出初始值。类和结构体给出构造函数。比如int,在vs的debug和release模式下,初始化的值是不同的。 阅读全文
posted @ 2015-04-01 11:33 陆草纯 阅读(259) 评论(1) 推荐(0) 编辑
摘要: stoi函数默认要求输入的参数字符串是符合int范围的[-2147483648, 2147483647],否则会runtime error。atoi函数则不做范围检查,若超过int范围,则显示-2147483648(溢出下界)或者2147483647(溢出上界)。 阅读全文
posted @ 2015-03-28 18:07 陆草纯 阅读(1261) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页