上一页 1 2 3 4 5 6 ··· 10 下一页
2021年11月30日
摘要: 题目 https://leetcode.com/problems/path-with-minimum-effort/ 每个节点的height不同,矩阵从左上走到右下,求最小体力消耗 当前点体力消耗:max(来的那个节点的effort,|来的那个节点height-当前节点height|) 总最小体力消 阅读全文
posted @ 2021-11-30 06:12 alau 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appe 阅读全文
posted @ 2021-11-30 02:17 alau 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题目347 https://leetcode.com/problems/top-k-frequent-elements/ 347简单些,692是其变式,多了一种排序 Given an integer array nums and an integer k, return the k most fre 阅读全文
posted @ 2021-11-30 01:41 alau 阅读(16) 评论(0) 推荐(0) 编辑
2021年11月29日
摘要: 题目 找到一串数字中的第K大元素 在原数组的基础上,每次会不断插入元素 插入的同时要返回插入后第K大的元素 https://leetcode.com/problems/kth-largest-element-in-a-stream/ Design a class to find the kth la 阅读全文
posted @ 2021-11-29 04:10 alau 阅读(47) 评论(0) 推荐(0) 编辑
2021年11月28日
摘要: 问题 求最长回文子串,即左右对称 Given a string s, return the longest palindromic substring in s. Example 1: Input: s = "babad" Output: "bab" Note: "aba" is also a va 阅读全文
posted @ 2021-11-28 06:27 alau 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 题目 下雨天的蓄水量计算 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after ra 阅读全文
posted @ 2021-11-28 04:54 alau 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 题目 机器人从(0,0)出发,初始化向北 三种指令 G当前方向+1步,L左转90度,R右转90度 问指令结束后是否成圆圈(只有可能回原点时才成圈) 返回true/false On an infinite plane, a robot initially stands at (0, 0) and fa 阅读全文
posted @ 2021-11-28 00:36 alau 阅读(209) 评论(0) 推荐(0) 编辑
2021年11月26日
摘要: 题目 深复制一个list* Node的结构包含next和random(随机指向节点) 区别 深复制 deep copy Node a=New Node(1) Node b=new Node(1) 复制值 浅复制 shallow copy Node a=new Node(1); Node b=a; 复 阅读全文
posted @ 2021-11-26 21:32 alau 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 遇到的一些基础坑 **注意int size=q.size(),再把size放进for循环。直接for(i;i<q.size();i++)报错 https://www.cnblogs.com/inku/p/15591457.html return tmp.next;//不能直接head,head本身可 阅读全文
posted @ 2021-11-26 05:16 alau 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 310题目类似,但是数据结构可以选的更简单 恢复内容开始 题目 先修课程和后修课,比如高数离散修完,才能修数据结构 给定numcourse门课程,int[][]的先后计划。int[i][0]为要修的当前课程,int[i][1]为学这门课之前要修的课 207/210都在问:按照int[][],所有课程 阅读全文
posted @ 2021-11-26 05:14 alau 阅读(14) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页