当前位置:网站首页>6.28 problem solving
6.28 problem solving
2022-06-29 23:43:00 【After all, I still walk alone】
Today, I brushed two questions in order on the button .
The first question is to reverse the linked list .

This is the topic ,
I used a traversal . Then two nodes and one node are used to record the next node . A node is used to record a node . Then point the pointer of the node being traversed to the previous node . Then traverse to the last You can reverse the pointers of all nodes .

The specific code and comments are like this .
The second question is Longest substring without repeating characters .

The topic here is based on the idea of sliding window . If I want to add a letter that already has a repeating letter in the substring . Then I have to remove the repeated characters and all the previous characters from this string before I can add this character into a string without any repeated characters , Then I used one vector Container to record the position of each character in the string . Then use this container to judge and update . The value in the new Victor container is updated every time a duplicate character is added . And then use max Function to find the maximum value in the traversal process .

The code and comments are here
边栏推荐
猜你喜欢
随机推荐
Leetcode 1385. 两个数组间的距离值
Solr基础操作4
机器学习:VC维的概念和用途
動態代理的實現原理
6.29日刷题题解
数莓派 4怎么样?可能的玩法有哪些?
软件测试 接口测试 Jmeter 5.5 安装教程
Remember the process of checking online MySQL deadlock. You should not only know curd, but also know the principle of locking
25 interview questions about Apache
flutter 插件版本冲突的解决方法
收藏!这些提高程序员生产力的工具你用过吗?
C指针进阶1-->字符指针,数组指针,指针与数组传参,函数指针
Incluxdb time series database system
Golang泛型的巧妙应用,防止变量空指针错误,防止结构体字段空指针错误
[译]在软件开发行业工作 6 年后,那些年我曾改过的观念
Project 1 - buffer pool [cmu 15-445645] notes
@Scheduled注解的坑,我替你踩了
设置安全组、域名备案、申请ssl证书
Label Troubleshooting: unable to open the marked image
打造一个 API 快速开发平台,牛逼!








