摘要:
Remove Linked List ElementsRemove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,va... 阅读全文
摘要:
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... 阅读全文
摘要:
Isomorphic StringsGiven two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
最好在定义的时候就给出初始值。类和结构体给出构造函数。比如int,在vs的debug和release模式下,初始化的值是不同的。 阅读全文
摘要:
stoi函数默认要求输入的参数字符串是符合int范围的[-2147483648, 2147483647],否则会runtime error。atoi函数则不做范围检查,若超过int范围,则显示-2147483648(溢出下界)或者2147483647(溢出上界)。 阅读全文