Community

Start a Thread


Notifications
Subscribe You’re not receiving notifications from this thread.

Find Duplicate Words (Main Thread)

Here is the interview question prompt, presented for reference.

A very common interview challenge is to determine how often words appear in a given string or set of strings. Here's a version of this: return a list of duplicate words in a sentence.

For example, given 'The dog is the best', returns ["the"].

Likewise, given 'Happy thanksgiving, I am so full', you would return an empty array. This is because there are no duplicates in the string.

Constraints

  • The total length of the string <= 100000
  • The string will consist of ASCII characters (may be some or all)
  • Expected time complexity : O(n) where n are the number of words in the string
  • Expected space complexity : O(n)

You can see the full challenge with visuals at this link.

Challenges • Asked about 4 years ago by Anonymous

Jake from AlgoDaily Commented on Apr 08, 2020:

This is the main discussion thread generated for Find Duplicate Words.

Anonymous Commented on Apr 08, 2020:

[deleted]

int2k Commented on Oct 29, 2022:

hi How can I submit this with several other tests? I only found "run code".

In addition to that, when I click on "Your submission", the page turns blank

Liam Smith Commented on Jan 17, 2023:

Hello, mates! According to the unemployed professors review reddit, the company provides not the worst assistance possible, but there still exist better experts. Can you give me some recommendations and descriptions of the sites that you use to stabilize and improve grades? Thanks!