摘要:
1 package day20170206; 2 //LeetCode:441. Arranging Coins 3 /* 4 You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. 5 Given n... 阅读全文
摘要:
1 package day20170206; 2 //LeetCode:374. Guess Number Higher or Lower 3 /* 4 We are playing the Guess Game. The game is as follows: 5 I pick a number from 1 to n. You have to guess which number... 阅读全文
摘要:
1 package day20170206; 2 //LeetCode:53. Maximum Subarray 3 /* 4 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. 5 6 For example, given... 阅读全文
摘要:
1 package day20170206; 2 //LeetCode:367. Valid Perfect Square 3 /* 4 Given a positive integer num, write a function which returns True if num is a perfect square else False. 5 6 Note: Do not ... 阅读全文
摘要:
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.... 阅读全文
摘要:
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: ... 阅读全文
摘要:
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... 阅读全文