码迷,mamicode.com
首页 >  
搜索关键字:roman to integer    ( 15811个结果
leetcode 787 K 站中最便宜的航班 DP
状态转移方程的定义为:dp( K,i ) 表示经历 K 站乘坐到 flight[i] 航班终点的最低票价。 因为 flight 中的元素存在前后置关系,所以乘坐某航班的上一航班的集合是可以确定的。 dp( K,i ) = Math.min( dp( K-1,j ) ),其中 j 为可以作为上一趟航班 ...
分类:其他好文   时间:2020-11-01 10:08:43    阅读次数:15
css计算属性带逻辑
实例 指定段落的字体: p{font-family:"Times New Roman",Georgia,Serif;} 尝试一下 » 属性定义及使用说明 font - family属性指定一个元素的字体。 font-family 可以把多个字体名称作为一个"回退"系统来保存。如果浏览器不支持第一个字 ...
分类:Web程序   时间:2020-10-31 01:44:00    阅读次数:30
ResultVM 返回前端实体类
* Created by cws */ @Data public class ResultVM implements Serializable { private static final long serialVersionUID = 1L; public static final Integer ...
分类:其他好文   时间:2020-10-31 01:21:33    阅读次数:20
228. Summary Ranges - Easy
You are given a sorted unique integer array nums. Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, ...
分类:其他好文   时间:2020-10-30 11:55:20    阅读次数:20
LeetCode 128. 最长连续序列
当我按照官方的思路写出代码,提交后并未通过,查看错误,发现算法错误的将[2147483647,-2147483648]也视为连续的整数了,这是因为我没有考虑到int类型的边界。将代码稍加修改,即成功提交 //哈希表,建议看官方的题解,尤其是演示动画 class Solution { public i ...
分类:其他好文   时间:2020-10-29 10:20:41    阅读次数:23
LeetCode 217. 存在重复元素
//通过哈希表来查重 class Solution { public boolean containsDuplicate(int[] nums) { Set<Integer> set = new HashSet<>(); for(int i = 0;i < nums.length;i++){ if( ...
分类:其他好文   时间:2020-10-29 10:06:06    阅读次数:17
LeetCode 145. 二叉树的后序遍历
class Solution { public List<Integer> postorderTraversal(TreeNode root) { //一般解法,前序遍历后,翻转下结果集,注意下 与前序遍历的进栈顺序不一样 //(前序) 根左右 --> 变为 根右左 --> 翻转 左右根 (后续) ...
分类:其他好文   时间:2020-10-27 11:40:04    阅读次数:20
sqlite
数据库 con.Execute(string.Format(@"CREATE TABLE Category ( Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name VARCHAR (50) NOT NULL, Pid INTEGER, Creati ...
分类:数据库   时间:2020-10-27 10:51:41    阅读次数:31
常用算法列举
1. 深度优先遍历 使用场景:常见于各种组合,树遍历,前序遍历、中序遍历、后续遍历 private void dfs(int[] arr, int target,int begin, Deque<Integer> path, Set<List<Integer>> res) { if ( path.s ...
分类:编程语言   时间:2020-10-26 10:56:27    阅读次数:26
遍历集合的四种方式
以ArrayList为例。 List<Integer> list = new ArrayList<>(); for(int i=0;i<11;i++){ List.add(i);} 遍历方式一:普通for循环(适合ArrayList。) for(int i=0;i<list.size();i++){ ...
分类:其他好文   时间:2020-10-26 10:41:31    阅读次数:24
15811条   上一页 1 ... 22 23 24 25 26 ... 1582 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!