Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #10696
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| Newsgroups | comp.programming |
| Subject | Re: Coding while drunk and stoned take 2. (Yes, I know this is a cross post) |
| Date | Thu, 27 Feb 2020 21:06:27 +0000 |
| Organization | A noiseless patient Spider |
| Lines | 27 |
| Message-ID | <87a753viy4.fsf@bsb.me.uk> (permalink) |
| References | <0b8d1b58-3651-47ed-a2b8-63dc1d659c91@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | reader02.eternal-september.org; posting-host="c5b2f88804383f9a4f3ed96188f26610"; logging-data="12879"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18r8I7iI0Hhhh/o6PaaYOHXPR5y4yLYwEs=" |
| Cancel-Lock | sha1:TfqGAKgwiOTiuZXVIdg9xzJ3N70= sha1:Hg8Nfl/m7YovRoojtFQaJIy8JrA= |
| X-BSB-Auth | 1.d64db599aaa773d3a81d.20200227210627GMT.87a753viy4.fsf@bsb.me.uk |
| Xref | csiph.com comp.programming:10696 |
Show key headers only | View raw
"Chad Altenburg, Ph.D." <cdalten@gmail.com> writes:
> https://codingbat.com/prob/p180759
>
> And here is the problem statement...
>
> Look for patterns like "zip" and "zap" in the string -- length-3,
> starting with 'z' and ending with 'p'. Return a string where for all
> such words, the middle letter is gone, so "zipXzap" yields "zpXzp".
>
> zipZap("zipXzap") → "zpXzp"
> zipZap("zopzop") → "zpzp"
> zipZap("zzzopzop") → "zzzpzp"
There's are some interesting corner cases. What about
zipZap("zipp") → "zpp" or "zp"?
And if "overlapping" zXp strings like this are to be ignored, the
problem statement is not clear about
zipZap("zzpp") → "zpp" or "zzp"?
You get different result from forward and reverse scans.
--
Ben.
Back to comp.programming | Previous | Next — Previous in thread | Find similar | Unroll thread
Coding while drunk and stoned take 2. (Yes, I know this is a cross post) "Chad Altenburg, Ph.D." <cdalten@gmail.com> - 2020-02-27 06:04 -0800
Re: Coding while drunk and stoned take 2. (Yes, I know this is a cross post) Julio Di Egidio <julio@diegidio.name> - 2020-02-27 07:24 -0800
Re: Coding while drunk and stoned take 2. (Yes, I know this is a cross post) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-27 15:55 +0000
Re: Coding while drunk and stoned take 2. (Yes, I know this is a cross post) Julio Di Egidio <julio@diegidio.name> - 2020-02-27 08:06 -0800
Re: Coding while drunk and stoned take 2. (Yes, I know this is a cross post) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-27 21:00 +0000
Re: Coding while drunk and stoned take 2. (Yes, I know this is a cross post) "Chad Altenburg, Ph.D." <cdalten@gmail.com> - 2020-02-27 15:18 -0800
Re: Coding while drunk and stoned take 2. (Yes, I know this is a cross post) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-02-27 21:06 +0000
csiph-web