bytedancers
bytedancers
全部文章
分类
面经(1)
题解(7)
归档
标签
去牛客网
登录
/
注册
bytedancers的博客
全部文章
(共8篇)
题解 | #数组中只出现一次的数(其它数出现k次)#
python只能调用ctypes来做吹了位运算的结果了 class Solution: def foundOnceNumber(self , arr , k ): # write code here res = 0 for i in range...
2021-09-05
0
409
题解 | #最长递增子序列#
python使用bisect和patient sort, 借助pre记录每个位置的前驱 import bisect class Solution: def LIS(self , arr ): stack = [0] pre = [-1] * len(arr) ...
2021-09-05
1
470
题解 | #链表中的节点每k个一组翻转#
最短python递归版本,自解释 class Solution: def reverseKGroup(self , head , k ): t = head for i in range(k): if t is None: ...
python
2021-08-01
3
554
patient sort + 记录前驱位置
class Solution: def LIS(self, arr): stack = [0] n = len(arr) pre = [-1] * n for i in range(1, n): if a...
python
LIS
快手
2021-04-01
3
724
2021 3.23 美团一面视频面加阿里一面电话面
美团一面视频 先问项目(我做的是open domain QA的,面试官可能不是很熟悉,) 因为项目用到了Bert,问你对bert熟悉吗 介绍bert 介绍bert中的attention,self attention具体如何实现,QKV attention中根号n的作用是什么 Bert中其他的at...
美团
阿里
面经
2021-03-23
2
1116
小美的新游戏-DFS
使用增量字典减少代码量和判断流程python可能超过最大递归深度,需要手动设置增大递归深度 import sys sys.setrecursionlimit(100000) n, m, P, Q = map(int, input().strip().split()) grid = [] for i ...
2021-03-13
1
757
小美的美丽树-DFS
DFS即可 from collections import defaultdict N, K = map(int, input().strip().split()) tree = list(map(int, input().strip().split())) adj = defaultdict(l...
2021-03-13
1
969
两个指针即可
T = int(input().strip()) import heapq def find_next(tables, i, num): tlen = len(tables) while i < tlen and tables[i] != num: i += 1...
2021-03-12
1
664