- 博客(2)
- 收藏
- 关注
转载 LeetCode里的7.反转整数问题 Java15行
如何处理正负数以及溢出问题? 溢出时,循环中新的结果与上一个结果不相等,此时返回0. public int reverse(int x) { int result = 0; while (x != 0) { int tail = x % 10; int newResult = result * 10 + tail;
2017-12-30 18:23:51 156
转载 Leetcode 里的 Trapping Rain Water问题
问题: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example, Given [0,1,0,2,1,0,1,3,2,1,2,
2017-12-26 15:09:01 162
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人