Skip to content

Instantly share code, notes, and snippets.

View mindthink's full-sized avatar
🎯
Focusing

mindthink mindthink

🎯
Focusing
View GitHub Profile
@mindthink
mindthink / palibdrome.c
Last active February 25, 2017 01:14
回文判断 ( 给定字符串,如何判断这个字符串是否是回文串)
book IsPalindrome(const char *s,int n)
{
//非法输入
if(s == NULL || n < 1)
{
return false;
}
const char* front,*back;
//初始化头指针和尾指针
@mindthink
mindthink / 41.py
Created March 10, 2017 00:30
leetcode 41:First Missing Positive
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 / 412.py
Created March 10, 2017 00:45
leetcode 412:Fizz Buzz
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 / 88.py
Created March 10, 2017 02:33
leetcode 88
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 / setup-zeromq.sh
Created April 23, 2021 12:46 — forked from hstm/setup-zeromq.sh
Setup zeromq in Ubuntu 16.04/Windows Subsystem for Linux (WSL)
#!/bin/bash
# Ref http://zeromq.org/intro:get-the-software
wget https://github.com/zeromq/libzmq/releases/download/v4.2.3/zeromq-4.2.3.tar.gz
# Unpack
tar xvzf zeromq-4.2.3.tar.gz
# Install dependencies
sudo apt-get update && \