Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

mindthink mindthink

🎯
Focusing
Block or report user

Report or block mindthink

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 88.py
class Solution(object):
def merge(self, nums1, m, nums2, n):
"""
:type nums1: List[int]
:type m: int
:type nums2: List[int]
:type n: int
:rtype: void Do not return anything, modify nums1 in-place instead.
"""
i = m - 1
@mindthink
mindthink / 412.py
Created Mar 10, 2017
leetcode 412:Fizz Buzz
View 412.py
class Solution(object):
def fizzBuzz(self, n):
"""
:type n: int
:rtype: List[str]
"""
l = []
for i in range(1, n + 1):
if i % 3 == 0 and i % 5 == 0:
l.append("FizzBuzz")
@mindthink
mindthink / 41.py
Created Mar 10, 2017
leetcode 41:First Missing Positive
View 41.py
class Solution(object):
def firstMissingPositive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
max_num = len(nums) +1
nums_set = set(nums)
for i in range(1, max_num):
if i not in nums_set:
@mindthink
mindthink / palibdrome.c
Last active Feb 25, 2017
回文判断 ( 给定字符串,如何判断这个字符串是否是回文串)
View palibdrome.c
book IsPalindrome(const char *s,int n)
{
//非法输入
if(s == NULL || n < 1)
{
return false;
}
const char* front,*back;
//初始化头指针和尾指针
You can’t perform that action at this time.