摘要: 1 package Today; 2 //LeetCode:476. Number Complement 3 /* 4 Given a positive integer, output its complement number. 5 The complement strategy is to flip the bits of its binary representation.... 阅读全文
posted @ 2017-02-06 11:25 蒲公英的花朵 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 1 package Today; 2 //LeetCode:485. Max Consecutive Ones 3 /* 4 Given a binary array, find the maximum number of consecutive 1s in this array. 5 6 Example 1: 7 Input: [1,1,0,1,1,1] 8 Output: ... 阅读全文
posted @ 2017-02-06 11:25 蒲公英的花朵 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1 package Today; 2 //LeetCode:463. Island Perimeter 3 /* 4 You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. 5 Grid cells are conne... 阅读全文
posted @ 2017-02-06 11:24 蒲公英的花朵 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 1 package Today; 2 3 import java.util.HashMap; 4 import java.util.Map; 5 6 //LeetCode:167. Two Sum II - Input array is sorted 7 /* 8 Given an array of integers that is already sorted in as... 阅读全文
posted @ 2017-02-06 11:23 蒲公英的花朵 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 1 package Today; 2 //LeetCode:492. Construct the Rectangle 3 /* 4 For a web developer, it is very important to know how to design a web page's size. 5 So, given a specific rectangular web pag... 阅读全文
posted @ 2017-02-06 11:23 蒲公英的花朵 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 1 package Today; 2 //LeetCode:453. Minimum Moves to Equal Array Elements 3 /* 4 Given a non-empty integer array of size n, find the minimum number of moves required to make all array 5 elements... 阅读全文
posted @ 2017-02-06 11:22 蒲公英的花朵 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1 package Today; 2 //LeetCode:35. Search Insert Position 3 /* 4 Given a sorted array and a target value, return the index if the target is found. 5 If not, return the index where it would be ... 阅读全文
posted @ 2017-02-06 11:21 蒲公英的花朵 阅读(128) 评论(0) 推荐(0) 编辑
摘要: package Today;//LeetCode:459. Repeated Substring Pattern/* Given a non-empty string check if it can be constructed by taking a substring of it and app 阅读全文
posted @ 2017-02-06 11:20 蒲公英的花朵 阅读(225) 评论(0) 推荐(0) 编辑