当前位置:网站首页>(Dynamic Programming Series) sword finger offer 48. the longest substring without repeated characters
(Dynamic Programming Series) sword finger offer 48. the longest substring without repeated characters
2022-07-26 02:12:00 【ThE wAlkIng D】
Title Description

Problem analysis
Dynamic planning
Trilogy : determine dp[i] meaning
List the equation of state
Determine the initial value 
Code instance
class Solution {
public int translateNum(int num) {
String s = String.valueOf(num);
int[] dp = new int[s.length() + 1];
dp[0] = 1;
dp[1] = 1;
for(int i = 2;i <= s.length();i++){
String temp = s.substring(i - 2 , i);
if(temp.compareTo("10") >= 0&&temp.compareTo("25") <= 0){
dp[i] = dp[i - 1] + dp[i - 2];//
}
else{
dp[i] = dp[i - 1];
}
}
return dp[s.length()];
}
}
边栏推荐
- 数仓:银行业数仓的分层架构实践
- Advantages of composition API
- Common shell operations in Phoenix
- 国标GB28181协议视频平台EasyGBS消息弹框模式优化
- Ti AM335X工控模块矩阵键盘电路的设计与驱动移植
- Make and makefile summary I
- [C language brush leetcode] 814. Binary tree pruning (m)
- 【2021】【论文笔记】6G技术愿景——OTFS调制技术
- Redis cluster construction (based on 6.x)
- TI AM335x工控模块网络跟文件系统NFS的实现
猜你喜欢

【2020】【论文笔记】磁控溅射法生长Bi2Te3/CoFeB双层异质结——

1. Mx6ul core module serial USB interface test (VI)

C# 迭代器的实现

QT program beautification of the use of style sheets, QT uses pictures as the background and transparency of controls, QT custom button styles

微信小程序解密并拆包获取源码教程

I.MX6UL核心模块使用连载-CAN、蜂鸣器测试 (十一)
![[paper reading] coat: CO scale conv attentional image transformers](/img/d4/13ac8cdce07999d4fd51aa23173190.png)
[paper reading] coat: CO scale conv attentional image transformers

I.MX6UL核心模块使用连载-eMMC读写测试 (四)

I.MX6UL核心模块使用连载-USB接口测试 (六)

obsidian移动端PC段同步
随机推荐
Leetcode algorithm 147. insert and sort the linked list
I.MX6UL核心模块使用连载-Iot-6ULX核心模块简要介绍 (一)
HTC手机官解、S-ON/S-OFF与超级CID的关系
ggplot2学习总结
c# 单元测试
阿里云Redis开发规范
1. Mx6ul core module uses serial EMMC read / write test (IV)
我来图书馆小程序签到流程分析
[C language brush leetcode] 443. Compressed string (m)
The slow loading of the first entry page of vite local operation
Kaggle registration method to solve the problem of man-machine verification
I.MX6UL核心模块使用连载-TF卡读写测试 (五)
LeetCode_动态规划_中等_264.丑数 II
[cloud native] 4.1 Devops foundation and Practice
I came to the library applet check-in process analysis
TCP三次握手四次挥手
数仓:浅谈银行业的数仓构建实践
图解B+树的插入过程
2022.7.25-----leetcode.919
Redis集群搭建(基于6.x)