- 博客(6)
- 收藏
- 关注
原创 Leetcode 1:Two Sum
Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note t
2015-10-04 17:01:44
338
原创 Leetcode 75:Sort Colors
Sort Colors Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use
2015-10-03 11:39:03
331
原创 Leetcode 67:Add Binary
Add Binary Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 1.【算法思路】先把二进制字符串转化为二进制相加后,得到十进制整形,后转化为二进制。 public class Solution {
2015-10-02 18:58:15
294
转载 Java 字符串和整型的转换
JAVA的整型与字符串相互转换 1如何将字串 String 转换成整数 int? A. 有两个方法: 1). int i = Integer.parseInt([String]); 或 i = Integer.parseInt([String],[int radix]); 2). int i = Integer.valueOf(my_str).intVal
2015-10-02 16:49:26
703
原创 Leetcode 202:Happy Number
Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares o
2015-10-02 08:54:40
341
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人