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:56:39 GMT Lines: 23 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net SptV5j8m8Fx92ObWHQSokgknb7StWlPByei+ND4rG8FTRezwwD Cancel-Lock: sha1:WwsAPfIh6YPBlQo7NJ5JivT4+ec= sha256:gcL/KiA07JnW4cUxbynx3eNEdj5GgCPeVnyP6cPvjSU= User-Agent: Pan/0.162 (Pokrosvk) Xref: csiph.com comp.os.linux.misc:77340 On Tue, 11 Nov 2025 00:48:59 -0500, c186282 wrote: > On 11/10/25 20: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. ;) > > Ah, but for anagrams you need a HUGE dict of words to compare with. > Then you have to search that list semi-efficiently. (Some) human > brains do that pretty well, but computers are not that bright - all > brute algos. A trie would work.