摘要:
leetcode数据库的题目,组合两个表,使用left join查询。 select p.FirstName,p.LastName,a.City,a.State from Person p left join Address a on p.PersonId = a.PersonId;
阅读全文
posted @ 2020-07-22 17:15
Sempron2800+
阅读(123)
推荐(0)
摘要:
我学习计算机有15年了,到目前为止,专业技术水平也达到了一个相对高的程度。这里所说的“高”,是跟15年前的我自己相比较,而不是跟其他人相比较,我不想引战,也不想被质疑。到现在为止,我的技能算是达到了我认可的程度,同时也达到了我能达到的近乎极限的程度。 常言道,学无止境。随着年龄的增长,到了现在35岁
阅读全文
posted @ 2020-06-06 14:06
Sempron2800+
阅读(104)
推荐(0)
摘要:
1 class Solution: 2 def stringMatching(self, words: 'List[str]') -> 'List[str]': 3 n = len(words) 4 words = sorted(words,key=lambda x:len(x)) 5 res =
阅读全文
posted @ 2020-04-12 12:41
Sempron2800+
阅读(184)
推荐(0)
摘要:
C++的实现: 1 class Solution { 2 public: 3 int maxRotateFunction(vector<int>& A) { 4 long N = A.size(); 5 long S = 0; 6 long t = 0; 7 for (int i = 0; i <
阅读全文
posted @ 2020-04-09 10:43
Sempron2800+
阅读(189)
推荐(0)
摘要:
1 class Solution: 2 def validUtf8(self, data): 3 # 标记这个字节是某个编码的第几个字节 4 n_bytes = 0 5 6 # 遍历数组 7 for num in data: 8 9 # 获取二进制编码,保留最低8位 10 bin_rep = for
阅读全文
posted @ 2020-04-09 10:42
Sempron2800+
阅读(206)
推荐(0)
摘要:
1 class Solution { 2 public: 3 int lastRemaining(int n) { 4 if (n == 1) return 1; 5 return 2 * (n / 2 + 1 - lastRemaining(n / 2)); 6 7 // vector<int>
阅读全文
posted @ 2020-04-09 10:40
Sempron2800+
阅读(223)
推荐(0)
摘要:
1 class Solution(object): 2 def lengthLongestPath(self, input): 3 """ 4 :type input: str 5 :rtype: int 6 """ 7 input = input.split('\n') 8 res = 0 9 s
阅读全文
posted @ 2020-04-09 10:34
Sempron2800+
阅读(166)
推荐(0)
摘要:
1 class Solution: 2 def kSmallestPairs(self, nums1, nums2, k): 3 queue = [] 4 def push(i, j): 5 if i < len(nums1) and j < len(nums2): 6 heapq.heappush
阅读全文
posted @ 2020-04-09 10:30
Sempron2800+
阅读(237)
推荐(0)
摘要:
1 class Solution(object): 2 def largestDivisibleSubset(self, nums): 3 """ 4 :type nums: List[int] 5 :rtype: List[int] 6 """ 7 # The container that hol
阅读全文
posted @ 2020-04-09 10:27
Sempron2800+
阅读(139)
推荐(0)
摘要:
1 class Solution: 2 def superPow(self, a: int, b: List[int]) -> int: 3 return pow(a,int(''.join(map(str,b))),1337) 算法思路:直接调用python的pow函数。 学有余力的同学,可以尝试
阅读全文
posted @ 2020-04-09 10:18
Sempron2800+
阅读(135)
推荐(0)