Skip to content

Instantly share code, notes, and snippets.

View m2kar's full-sized avatar

M2kar m2kar

View GitHub Profile
@m2kar
m2kar / block_string.py
Created September 8, 2019 13:38
字节跳动笔试题目 走方块
# todo
import re
from logging import debug
import logging
logging.basicConfig(level=logging.DEBUG)
n,m,q=[int(i) for i in input().strip("\n").split()]
debug("n:{n} m:{m} q:{q}".format(n=n,m=m,q=q))
@m2kar
m2kar / 阅文题目
Created September 17, 2019 05:46
阅文面试题目
阅文
"""
逆序 单词
"""
s=input()
if len(s)==0:
print("")
else:
enddot=False
if s[-1]==".":
"""
计算字符串转换的最短距离
"""
def minDistance(word1, word2):
n = len(word1)
m = len(word2)
if n * m == 0:
"""
求不大于n的所有数质数分解后的质数总个数
快手笔试第3题
"""
from random import randint
def quickMulMod(a,b,m):
ret = 0
while b:
if b&1:
@m2kar
m2kar / 数独正确性检测.py
Created September 18, 2019 02:12
给定数独板,检测数独是否正确 快手笔试题4
"""
给定数独板,检测数独是否正确
快手笔试题4
"""
class E(Exception):
pass
def valid(l):
d={}
for v in l:
@m2kar
m2kar / 58.txt
Created September 21, 2019 12:23
58同城笔试题
58
@m2kar
m2kar / baidu
Created September 24, 2019 12:00
百度笔试题
1
@m2kar
m2kar / fib.go
Created October 15, 2019 03:16
斐波拉契数列 公式法 Go实现
import (
"math"
)
func fib(N int) int {
N=N-1;
s5:=math.Sqrt(5);
return int(math.Round((math.Pow((1+s5)/2 , float64(N+1)) - math.Pow((1-s5)/2, float64(N+1))) /s5));
}
@m2kar
m2kar / create_RuanZhu.py
Created November 6, 2019 03:03
合并软著的所有代码
import os,sys
flist=[]
with open("/home/rui/tmp/sflist.txt") as fp:
for l in fp.readlines():
l2=l.strip()
if l2=="#END":
break
flist.append(l2)
with open("/home/rui/tmp/output.txt","w") as fpo: