当前位置:网站首页>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 <= 100
s
from 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
边栏推荐
- . Ren -- the intimate artifact in the field of vertical Recruitment!
- Three. Based on ply format point cloud voxel model JS upload interface writing
- Error reported by Azkaban: Azkaban jobExecutor. utils. process. ProcessFailureException: Process exited with code 64
- Research on open source OCR engine
- [PTA] l1-006 continuity factor
- On BIM data redundancy theory
- Wave field Dao new species end up, how does usdd break the situation and stabilize the currency market?
- 考研英语唐叔的语法课笔记
- [graph theory brush question-5] Li Kou 1971 Find out if there is a path in the graph
- Rédaction de thèses 19: différences entre les thèses de conférence et les thèses périodiques
猜你喜欢
Sqoop imports tinyint type fields to boolean type
【栈和队列专题】—— 滑动窗口
Don't bother tensorflow learning notes (10-12) -- Constructing a simple neural network and its visualization
PCL点云处理之计算两平面交线(五十一)
Identification of bolt points in aerial photography based on perception
ArcGIS JS version military landmark drawing (dovetail arrow, pincer arrow, assembly area) fan and other custom graphics
Operation of numpy array
SIGIR'22 "Microsoft" CTR estimation: using context information to promote feature representation learning
DNS cloud school rising posture! Three advanced uses of authoritative DNS
Matlab analytic hierarchy process to quickly calculate the weight
随机推荐
Intersection calculation of straight line and plane in PCL point cloud processing (53)
Livego + ffmpeg + RTMP + flvjs to realize live video
R language ggplot2 visual facet_wrap, and use the lineheight parameter to customize the height of the facet icon tab (gray label bar)
Solution to PowerDesigner's failure to connect to MySQL in x64 system
Analysis of the relationship between generalized Bim and CAD under the current background
bounding box iou
【问题解决】‘ascii‘ codec can‘t encode characters in position xx-xx: ordinal not in range(128)
Some basic configurations in interlij idea
Experience of mathematical modeling in 18 year research competition
Markdown < a > tag new page open link
6-5 字符串 - 2. 字符串复制(赋值) (10 分)C语言标准函数库中包括 strcpy 函数,用于字符串复制(赋值)。作为练习,我们自己编写一个功能与之相同的函数。
Mysql database and table building: the difference between utf8 and utf8mb4
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
[graph theory brush question-4] force deduction 778 Swimming in a rising pool
Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
Cadence OrCAD capture batch change component packaging function introduction graphic tutorial and video demonstration
16MySQL之DCL 中 COMMIT和ROllBACK
The market share of the financial industry exceeds 50%, and zdns has built a solid foundation for the financial technology network
一. js的深拷贝和浅拷贝
【栈和队列专题】—— 滑动窗口