当前位置:网站首页>Leetcode 709, convert to lowercase
Leetcode 709, convert to lowercase
2022-04-23 20:26:00 【Die in a trap】
709、 Convert to lowercase
1) Title Description
Give you a string s , Convert the uppercase letters in the string to the same lowercase letters , Returns a new string .
Example 1:
Input :s = "Hello"
Output :"hello"
Example 2:
Input :s = "here"
Output :"here"
Example 3:
Input :s = "LOVELY"
Output :"lovely"
Tips :
1 <= s.length <= 100sfrom ASCII Composition of printable characters in the character set
2) analysis
Traversal string , In case of uppercase characters , Add 32 Convert to lowercase .
3)C++ Code
class Solution {
public:
string toLowerCase(string s) {
for(int i=0;i<s.length();i++){
if(s[i]>='A'&&s[i]<='Z')
s[i]+=32;
}
return s;
}
};
版权声明
本文为[Die in a trap]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232023107334.html
边栏推荐
- An error is reported in the initialization metadata of the dolphin scheduler -- it turns out that there is a special symbol in the password. "$“
- Use the rolling division method to find the maximum common divisor of two numbers
- LeetCode 20、有效的括号
- Latest investigation and progress of building intelligence based on sati
- DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
- Es keyword sorting error reason = fielddata is disabled on text fields by default Set fielddata = true on keyword in order
- 【PTA】L1-002 打印沙漏
- CVPR 2022 | querydet: use cascaded sparse query to accelerate small target detection under high resolution
- . Ren -- the intimate artifact in the field of vertical Recruitment!
- PCL点云处理之计算两平面交线(五十一)
猜你喜欢
![Es error: request contains unrecognized parameter [ignore_throttled]](/img/17/9131c3eb023b94b3e06b0e1a56a461.png)
Es error: request contains unrecognized parameter [ignore_throttled]

PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)

JDBC tool class jdbcfiledateutil uploads files and date format conversion, including the latest, simplest and easiest way to upload single files and multiple files

Identification of bolt points in aerial photography based on perception

Recognition of high-speed road signs by Matlab using alexnet

How to protect ECs from hacker attacks?

【栈和队列专题】—— 滑动窗口

Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
![[stack and queue topics] - sliding window](/img/65/a2ce87f1401d7a28d4cce0cc85175f.png)
[stack and queue topics] - sliding window

Mysql database backup scheme
随机推荐
Automatically fill in body temperature and win10 task plan
PostgreSQL basic functions
Installation and use of NVM
Introduction to link database function of cadence OrCAD capture CIS replacement components, graphic tutorial and video demonstration
Latest investigation and progress of building intelligence based on sati
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
After route link navigation, the sub page does not display the navigation style problem
Recognition of high-speed road signs by Matlab using alexnet
6-5 字符串 - 2. 字符串复制(赋值) (10 分)C语言标准函数库中包括 strcpy 函数,用于字符串复制(赋值)。作为练习,我们自己编写一个功能与之相同的函数。
Linux64Bit下安装MySQL5.6-不能修改root密码
What is the difference between a host and a server?
Livego + ffmpeg + RTMP + flvjs to realize live video
Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
LeetCode 709、转换成小写字母
Mysql database backup scheme
DOS command of Intranet penetration
[problem solving] 'ASCII' codec can't encode characters in position XX XX: ordinal not in range (128)
Zdns was invited to attend the annual conference of Tencent cloud basic resources and share the 2020 domain name industry development report
【PTA】L1-006 连续因子
Cadence OrCAD capture batch change component packaging function introduction graphic tutorial and video demonstration