Community

Start a Thread


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

Array Intersection: Solution doesn't run in IDE, but runs in my Terminal

Challenges • Asked over 2 years ago by Kaitlin

Kaitlin Commented on Jan 20, 2023:

Can you tell me what's wrong here?

My solution isn't running in the AlgoDaily IDE. The error says: "No Output."
However, the seems to return the correct result when I run it in Python on my Terminal.


Screenshot from Algo Daily: https://ibb.co/r4T39fp
Screenshot of my Terminal: https://ibb.co/Z26S66y

Why doesn't this run? Also, the Python solution given for sets in this example is incomplete. In the Javascript video, the set solution is shown with a filter method, which isn't included at all in the Python solution, which seems to try to recursively call on itself. This solution should probably be updated with the line that runs a filter with lambda function.

===
EDIT 1: Realizing that trying to add images with markdown that were uploaded to ImgBB doesn't actually work on this forum, so displaying screenshots inside this post is impossible... 🐛🐞 Here are the links to click on to see the images hosted on ImgBB.

EDIT 2: Realizing that markdown for including links ALSO doesn't work on this forum. 🐞🐛 So, copy-pasting the links would be necessary to view these images.

Hmm...maybe fixing the forum so that Markdown is enabled, or removing the toolbar and illusion that this feature is possible, would be a first priority over fixing the incorrect Python solution code and broken Python IDE. I don't know.

Team AlgoDaily Commented on Jan 21, 2023:

Hi Kaitlin,

In your screenshot, it appears you're not actually invoking or logging the function.

You need to actually call intersection(first, second) and then actually print it, something like:

SNIPPET
print(intersection(first, second))

We'll update that screen to make it more clear!

Kaitlin Commented on Jan 23, 2023:

Ah thanks for that, Jake! Really silly mistake on my part. Appreciate your response!

BernaLuke Commented on Feb 09, 2023:

This is useful information !

Team AlgoDaily Commented on Jun 11, 2025:

Glad you got it working.

On the set-based Python solution: you’re right, our displayed reference had a typo. We’ll patch it. Two correct patterns depending on what the prompt expects:

  • Unique intersection (order not guaranteed):

    def intersection(a, b):
    return list(set(a) & set(b))

  • Preserve order of the first list (no deduping):

    def intersection(a, b):
    s2 = set(b)
    return [x for x in a if x in s2]

IDE note: our runner checks stdout. If you only return from a function, you’ll see “No Output.” Make sure to print the result, e.g.:

print(intersection(first, second))

We’ll update the prompt text to make that explicit.

Forum formatting: we currently sanitize images and rich links. We’ll either enable safe markdown or remove the toolbar to avoid confusion. For now, pasting raw URLs is the best approach.

Moderation: quick reminder to keep replies relevant and avoid dropping unrelated external links. We’ve removed the off-topic link above.