LintCode:字符大小写排序
来源:互联网 发布:影像混搭软件 编辑:程序博客网 时间:2024/05/03 09:56
LintCode:字符大小写排序
双指针。
class Solution: """ @param chars: The letters array you should sort. """ def sortLetters(self, chars): # write your code here m = 0 n = len(chars) - 1 while(m < n): while chars[m] > 'Z' and m < n: m += 1 while chars[n] <= 'Z' and m < n: n -= 1 chars[m], chars[n] = chars[n], chars[m] m = m + 1 n = n - 1
0 0
- 字符大小写排序(LintCode)
- LintCode:字符大小写排序
- Lintcode 字符大小写排序
- LintCode 49 字符大小写排序
- [Lintcode] #49 字符大小写排序
- [LintCode] 字符大小写排序 Sort Letters by Case
- Lintcode 字符大小写排顺序
- 题目:字符大小写排序
- 字符大小写排序
- 字符大小写排序
- lintcode --字符大小排序
- Java实现-字符大小写排序
- 利用 Arrays.sort 字符串 进行排序 完全按字符 排序 忽略字符大小写
- 利用 Arrays.sort 字符串 进行排序 完全按字符 排序 忽略字符大小写
- 字符的大小写转换
- MySQL的字符大小写
- 字符比较大小写
- 字符大小写转换
- C++第4次作业
- MySQL 命令大全
- 用py2exe打包成一个exe文件
- LeetCode_ House Robber(Ⅰ)、(Ⅱ)、(Ⅲ)
- jetty使用方法
- LintCode:字符大小写排序
- eclipse兼容中文配置
- 设计模式(二)单例模式
- Using Automatic Memory Management
- Linux性能测试命令系列(3)- ps
- Android SDK离线文档打开慢解决方法
- 顺时针打印矩阵
- 用Spring Cloud和Docker构建微服务
- C++作业4