摘要:
当 arr 是一个array时,写Java开始的corner case常常会写类似下面的语句:if(arr == null || arr.length == 0){ return 0;}其实这是两个条件, arr==null 和 arr.length==0 是不同的:arr.length ==... 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/add-digits/ 题目: Given a non-negative integer num, repeatedly add all its digits until the result has only one di 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/divide-two-integers/ 题目: Divide two integers without using multiplication, division and mod operator. If it is o 阅读全文