- 博客(4)
- 收藏
- 关注
原创 字节面试中遇到的一道代码题
题目:编写递归算法求最大重复字串,比如"aaabbcc"的最大重复字串为’aaa’,"aab"最大重复字串为‘aa’,并编写测试用例。class Solution: def repeatTimes(self, s): n = len(s) if n == 0: return None c = {} for i in range(n): if s[i] not in c.keys(): c[s[i]] = 1 else: c[s[i]] += 1 c
2021-04-20 09:29:49
363
原创 python数据结构
利用python实现单链表#!/usr/bin/env python# -*- coding: utf-8 -*-# @File : single_link_list.py# @Date : 2021/4/16class Node: """单链表的节点""" def __init__(self, data): self.data = data self.next = Noneclass SingleLinkList: """单链表
2021-04-17 19:32:11
129
2
原创 SQLZOO刷题遇到的困难
SQLZOO上的难题sqlzoo难题——self join第十题Find the routes involving two buses that can go from Craiglockhart to Lochend.Show the bus no. and company for the first bus, the name of the stop for the transfer,and the bus no. and company for the second bus.Hint:Sel
2021-03-11 16:08:58
412
原创 牛客网刷题遇到的困难
牛客网SQL12:获取所有部门中当前员工薪水最高的相关信息解析:初看本题,不假思索地写下如下答案:SELECT dept_no, s.emp_no, MAX(salary) AS maxSalary FROM salaries s, dept_emp de WHERE de.emp_no = s.emp_noGROUP BY dept_noORDER BY dept_no;但是由于salaries.emp_no是非聚合列,放在SELECT中会默认返回该列的第一个记录,导致emp_no与最大s
2021-03-04 11:26:43
315
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人