Reverse String问题及解法
来源:互联网 发布:外微分 知乎 编辑:程序博客网 时间:2024/04/27 16:59
问题描述:
Write a function that takes a string as input and returns the string reversed.
示例:
Given s = "hello", return "olleh".
过程很简单,直接看代码即可
class Solution {public: string reverseString(string s) { string res = ""; for(int i = s.length(); i > 0; i--) { res.push_back(s[i - 1]);}return res; }};
0 0
- Reverse String问题及解法
- Reverse String II问题及解法
- Reverse Vowels of a String问题及解法
- Reverse Words in a String III问题及解法
- Reverse Words in a String问题及解法
- Reverse Integer问题及解法
- Reverse Linked List II问题及解法
- Evaluate Reverse Polish Notation问题及解法
- Magical String问题及解法
- Decode String问题及解法
- String Compression问题及解法
- String to Integer (atoi)问题及解法
- Repeated String Match问题及解法
- Permutation in String问题及解法
- 344. Reverse String的C++解法
- First Unique Character in a String问题及解法
- Number of Segments in a String问题及解法
- Find All Anagrams in a String问题及解法
- 浏览器内核
- SSL 1762——工厂的烦恼
- 网络编程
- python requests用法总结
- 接口测试总结
- Reverse String问题及解法
- iPhone,winphone,点击元素产生背景或边框怎么去掉
- windows下nginx安装、配置与使用
- MAC上安装centos
- 关于swift中的plist文件的写入用来存储信息,例如登录的时候出入信息,这里给一个完成的代码
- 蓝桥杯算法提高——6-17复数四则运算
- jsp--1.JSP基本语法
- How to Write and Publish a scientific paper-3
- 实验坑记录