Leetcode
Swain_Ho
Swain
展开
-
FizzBuzz
FizzBuzz原创 2016-11-11 11:27:55 · 292 阅读 · 0 评论 -
ReverseStringQuestion
Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". public String reverseString(String s) { return new StringBuild原创 2016-11-11 11:32:20 · 323 阅读 · 0 评论 -
HouseRobber
public int Rob(int[] house){int rob=0; int nonRob=0; int maxMoney=0; for(int i=0;i<house.length;i++){ rob=nonRob+house[i]; nonRob=maxMoney; maxMoney=Math.max(rob,nonRob); } return maxMoney; } p原创 2017-02-09 16:59:25 · 359 阅读 · 0 评论