- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 LeetCode || 198. House Robber
198. House Robber 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 you from robbing each of them
2016-02-24 20:41:20 455
原创 LeetCode || 299. Bulls and Cows
299. Bulls and Cows You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a gu
2016-02-24 20:13:55 960
原创 LeetCode ||326. Power of Three
326. Power of Three Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? 方法一: 循环的方法,最直观简单。耗时128ms. clas
2016-02-24 16:49:21 609
原创 LeetCode || Move Zeroes
Move Zeroes 题目链接:Move Zeroes Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1,
2016-02-24 16:27:02 370
原创 LeetCode || Nim Game
Nim Game 基本思想: 题目大致意思是:总共有N个球,A首先拿多少个球,然后B拿多少个球,单次拿球数量为1——3个之间,判断N为多少时A球必定能赢。 这道题目的类似版本在很多公司面试中出现。 主要是运用每次A拿m(1<=M<=3)个球,然后B拿4-m个球的思想来处理。 那么,可以轻松将这道题目转变为,当总球数量N为能被4整除时,则B必定会赢,反之A会赢。
2016-02-24 16:13:53 292
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人