Skip to content

yasmineTYM/MyLeetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyLeetcode

the experience of doing leetcode, maybe i can not solve all the problems by myself, but figuring out the algorithms is also a way of making progress, fighting ~ ^3^

##THE EASY PART

  • 292 Nim Game

#Datail

#292 Nim Game

###Leetcode Link: https://leetcode.com/problems/nim-game/ ###Source Link: https://github.com/yasmineTYM/MyLeetcode/blob/master/NimGame.cs ###My Solution: we can think these problem from the last stone, if you want to win, you may be have the last 1,2,3 stones. so your friend must have the 4th stones(counting from the end), you see, if the total number of the stone can be divided by 4, and no remainder, you are at the point of your friend, you must lose, else you will win.

#258 Add Digits

###Leetcode Link: https://leetcode.com/problems/add-digits/ ###Source Link: https://github.com/yasmineTYM/MyLeetcode/blob/master/AddDigits ###My Solution: I use three method, the first one is not totally correct when i test it in eclipse, the second one is recursive which i understand now, but the last which is the answer i haven't figure it out.

#283 Move Zeroes

###Leetcode Link: https://leetcode.com/problems/move-zeroes/ ###Source Link: https://github.com/yasmineTYM/MyLeetcode/blob/master/MoveZeroes

My Solution:

More details in the source link.

PS

在java中怎么声明数组 以及 怎么输出数组

#104 Maximum depth of binary tree

Leetcode Link:

https://leetcode.com/problems/maximum-depth-of-binary-tree/

Source Link:

https://github.com/yasmineTYM/MyLeetcode/blob/master/MaximumDepth

#202 Happy Number

Leetcode Link:

https://leetcode.com/problems/happy-number/ ###Source Link: https://github.com/yasmineTYM/MyLeetcode/blob/master/HappyNumber

PS

有关哈希表的问题

About

the experience of doing leetcode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages