From: "Nasser M. Abbasi" <nma@12000.org>
Subject: Re: How to check if letters are in a string?
Date: Sat, 18 Jul 2015 05:23:54 -0500
Date: 2015-07-18T05:23:54-05:00 [thread overview]
Message-ID: <mod9fp$80v$1@speranza.aioe.org> (raw)
In-Reply-To: 53a16384-fa63-479c-9421-553683dd6009@googlegroups.com
On 7/18/2015 4:00 AM, Trish Cayetano wrote:
> Hi,
>
> How do you check if (exact number of) letters are in a string?
>
> 1. This example should PASS because every letter is found in the string
> LETTERS: HID
> STRING: HIDDEN
>
I do not follow. The 'D' in 'letters' occur 1 time but it occurs
2 times in 'string'. So this is not the _exact number_ of
letters in the string.
> 2. This example should FAIL because the letters contain 2 N's but the string only has 1 N.
> LETTERS: NINE
> STRING: HIDDEN
>
So why now this fails when 'letters' has more N's than in string, but
the first case did not fail when 'letters' had less D's than in string?
I think your problem specifications is not clear.
--Nasser
next prev parent reply other threads:[~2015-07-18 10:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-18 9:00 How to check if letters are in a string? Trish Cayetano
2015-07-18 10:23 ` Nasser M. Abbasi [this message]
2015-07-18 10:52 ` Trish Cayetano
2015-07-18 11:07 ` Simon Clubley
2015-07-18 11:36 ` Björn Lundin
2015-07-18 12:48 ` Trish Cayetano
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox