
解题记录
文章平均质量分 50
aliez..
月亮也喜欢我
展开
-
力扣NC65 斐波那契数列
题目:描述大家都知道斐波那契数列,现在要求输入一个正整数 n ,请你输出斐波那契数列的第 n 项。斐波那契数列是一个满足fib(x)=\left\{ \begin{array}{rcl} 1 & {x=1,2}\\ fib(x-1)+fib(x-2) &{x>2}\\ \end{array} \right.fib(x)={1fib(x−1)+fib(x−2)x=1,2x>2的数列数据范围:1\leq n\leq 391≤n≤39要求:空间复杂度O(...原创 2021-10-27 10:13:48 · 156 阅读 · 0 评论 -
力扣NC103 反转字符串
题目:写出一个程序,接受一个字符串,然后输出该字符串反转后的字符串。(字符串长度不超过1000)数据范围:0 \le n \le 10000≤n≤1000要求:空间复杂度O(n)O(n),时间复杂度O(n)O(n)代码:## 反转字符串# @param str string字符串 # @return string字符串#class Solution: def solve(self, str): # 字符串转换成列表 l =...原创 2021-10-27 09:40:20 · 149 阅读 · 0 评论 -
Leecode之sql解题记录(一)
1、查找最晚入职员工的所有信息select * from employees order by hire_date desc limit 1思路:根据入职日期字段倒序排列,最晚 limit 12、查找所有已经分配部门的员工的last_name和first_name以及dept_noselect e.last_name,e.first_name,d.dept_nofrom employees as e,dept_emp as dwhere e.emp_no = d.emp_no..原创 2021-08-14 17:20:53 · 347 阅读 · 0 评论