摘要: Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. Note: 两个只含有数字的字符串相加。 解法: 对于每个字符转成对应的整数,然后相加,结果在写入 阅读全文
posted @ 2018-03-26 09:34 轻风舞动 阅读(567) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and 阅读全文
posted @ 2018-03-26 08:53 轻风舞动 阅读(643) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the  阅读全文
posted @ 2018-03-26 08:50 轻风舞动 阅读(459) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2018-03-26 08:17 轻风舞动 阅读(715) 评论(0) 推荐(0) 编辑
摘要: The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each hou 阅读全文
posted @ 2018-03-26 08:05 轻风舞动 阅读(356) 评论(0) 推荐(0) 编辑
摘要: Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so tha 阅读全文
posted @ 2018-03-26 07:10 轻风舞动 阅读(598) 评论(0) 推荐(0) 编辑
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
posted @ 2018-03-26 07:04 轻风舞动 阅读(2218) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
posted @ 2018-03-26 06:46 轻风舞动 阅读(791) 评论(0) 推荐(0) 编辑