Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: rbowman Newsgroups: comp.os.linux.misc Subject: Re: Python/C/Pascal ... How To Choose ? Date: 11 Nov 2025 19:43:11 GMT Lines: 22 Message-ID: References: <10eqid5$3du22$1@dont-email.me> <10etohi$am09$3@dont-email.me> <10eu0da$cjqi$2@dont-email.me> <10eu474$dvq5$1@dont-email.me> <10euslc$j4v6$1@dont-email.me> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net uZy4lGpKIY5O91lXWrU80Qb93U4MUotXVEhmQy6lBNxf+wMJfW Cancel-Lock: sha1:bPIZWSz9PFKvyszh9q38HcNZjDg= sha256:MAetaRYh/HcJ5N6Jwlypkd9rOG2EDm8wmStBc1E1WlM= User-Agent: Pan/0.162 (Pokrosvk) Xref: csiph.com comp.os.linux.misc:77337 On Tue, 11 Nov 2025 08:38:04 +0000, Pancho wrote: > On 11/11/25 01:40, Lawrence D’Oliveiro wrote: >> On Tue, 11 Nov 2025 00:35:54 +0000, Pancho wrote: >> >>> As a simple example, a function to check if one word is an anagram of >>> another word. This is a real life interview question I got wrong. >> >> Python 3.13.9 (main, Oct 15 2025, 14:56:22) [GCC 15.2.0] on linux >> Type "help", "copyright", "credits" or "license" for more >> information. >> >>> word1 = "asterisk" >> >>> word2 = "seaskirt" sorted(word1) == sorted(word2) >> True >> >> Easy-peasy. ;) > > Yes easy peasy, when you get it right, but it is also easy to go the > wrong way, generate all permutations, Generating all the possible anagrams would be more challenging that comparing two words.