#力扣 LeetCode1592. 重新排列单词间的空格 @FDDLC
发布日期:2021-06-30 21:03:12 浏览次数:2 分类:技术文章

本文共 310 字,大约阅读时间需要 1 分钟。

题目描述:

 

自测用例:

"  this   is  a sentence "" practice   makes   perfect""hello   world""  walks  udp package   into  bar a""a"" a""  a""  a  "

 

Java代码:

class Solution {    public String reorderSpaces(String s) {        char[] a=s.toCharArray();        int space=a[0]==' '?1:0,word=a[0]==' '?0:1;        for(int i=1;i

 

 

 

 

 

 

 

转载地址:https://liuxingchang.blog.csdn.net/article/details/115048801 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:#力扣 LeetCode290. 单词规律 @FDDLC
下一篇:#力扣 LeetCode1566. 重复至少 K 次且长度为 M 的模式 @FDDLC

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年04月06日 19时28分02秒