GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • All gists
  • Back to GitHub
  • Sign in
  • Sign up
  • All gists 40
  • Forked 1
  • Terms
  • Privacy
  • Security
  • Status
  • Community
  • Docs
  • Contact

This view

  • Original page
  • New address

GeezerVison is showing gist.github.com — wintercn’s gists

Instantly share code, notes, and snippets.

View wintercn's full-sized avatar

Shaofei Cheng wintercn

9.3k followers · 30 following
  • China
  • https://space.bilibili.com/8538662
View GitHub Profile
    • Recently created
    • Least recently created
    • Recently updated
    • Least recently updated
  • 1 file
  • 0 forks
  • 0 comments
  • 1 star
@wintercn
wintercn / RemoveMultipleSpaces.cs
Created March 28, 2012 16:26 — forked from Ninputer/RemoveMultipleSpaces.cs
模拟微面试之去空格
//请实现下面的函数,输入参数baseStr是一个(可以更改的)字符串,请将其中所有连续出现的多个空格都替换成一个空格,单一空格需保留。
//请直接使用baseStr的空间,如需开辟新的存储空间,不能超过o(N)(注意是小o,N是字符串的长度)。返回值是替换后的字符串的长度。
//样例代码为C#,但可以使用任何语言。如需使用任何库函数,必须同时给出库函数的实现。
class Program
{
public static int RemoveMultipleSpaces(char[] baseStr)
{
int r = 0, w = 0;
char c;
while (r < baseStr.Length)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.