07 2022 档案
摘要:链接:https://leetcode.cn/problems/house-robber/ 方法1 学会了动态规划思路后,我独立想出来的一个方法,缺点是代码不够优雅(dp和nums的序号有错位)。 我的代码 int max(int a,int b){ return a>b?a:b; } int ro
阅读全文
摘要:链接:https://leetcode.cn/problems/maximum-subarray/ 之前题解的博客:https://tsuish.gitee.io/p/7a78 注:之后把这篇博客整理到hexo 我的代码 int max(int a,int b){ return a>b?a:b; }
阅读全文
摘要:链接:https://leetcode.cn/problems/employees-with-missing-information/ 我的代码 方法一 select employee_id from Employees where employee_id not in (select employ
阅读全文
摘要:链接:https://leetcode.cn/problems/remove-duplicates-from-sorted-array/ 我的代码 int removeDuplicates(int* nums, int numsSize){ int diff = 0,now = nums[0]-1,
阅读全文
摘要:链接:https://leetcode.cn/problems/patients-with-a-condition/ 我的代码 select * from Patients where conditions like 'DIAB1%' or conditions like '% DIAB1%' 提交
阅读全文
摘要:链接:https://leetcode.cn/problems/group-sold-products-by-the-date 我的代码 select sell_date, count(distinct(product)) num_sold, GROUP_CONCAT(distinct(produc
阅读全文
摘要:链接:https://leetcode.cn/problems/fix-names-in-a-table 我的代码 select user_id, concat(ucase(left(name,1)),lcase(substr(name,2))) name from Users order by u
阅读全文
摘要:链接:https://leetcode.cn/problems/duplicate-emails/ 我的代码 select distinct a.email from person a inner join person b on a.id!=b.id and a.email = b.email 提
阅读全文
摘要:链接:https://leetcode.cn/problems/sqrtx/ 我的代码 int mySqrt(int x){ long res=0,i; for(i=1;i<=x;i++){ if(i*i>x){ break; } } res=i-1; return res; } 提交结果 提交结果
阅读全文
摘要:链接:https://leetcode.cn/problems/employees-earning-more-than-their-managers/ 我的代码: select a.name Employee from employee a where a.salary> (select b.sal
阅读全文
摘要:链接:https://leetcode.cn/problems/combine-two-tables/ 我的代码: SELECT person.FirstName firstName, person.LastName LastName, address.City city, address.Stat
阅读全文