Syllabus Lesson 21 of 141 · Fixation on yourself
Fixation on yourself

Compare your lists

Why it matters You cannot tell whether you think differently from the default until you put your ideas next to it. A number keeps you honest.

In the wrapped-log problem the three sealed AI answers were: sort a copy then binary search; walk to find the wrap then binary search; count each query directly. As tags from a fixed list:

TAGS = {"load-all", "scan", "sort", "binary-search", "sample", "index", "math", "cache", "precompute"}
AI_TAGS = [{"load-all", "sort", "binary-search"},   # sort a copy
           {"scan", "binary-search"},                # walk to the wrap
           {"scan"}]                                 # count each query

Now tag your own three approaches the same way, honestly: tag what each would really do, not what sounds good. Your list from the problem is in your saved draft; the starter prints it if this browser has it.

A score near 1 means your ideas were the AI's ideas. A score near 0 means you explored somewhere else. Neither is a grade: on many problems the common idea is right. It tells you where you started.

Recap Tag both lists with the same words, match each of yours to its closest AI idea, average. That is your overlap.

Your turn

Write closest(mine, ai_sets): the highest word-set overlap (shared tags divided by all different tags, 0 if both are empty) between mine and any set in ai_sets; accept lists or sets. Write overlap_with_ai(my_tags, ai_sets): the average of closest over your approaches (0 for none). Assign my_tags, one list of tags from TAGS per approach, then set score = overlap_with_ai(my_tags, AI_TAGS) and print it rounded to 2 places.

Spotted a problem in this lesson? Report it · Ask about this lesson

This exercise opens soon

Finish the lesson before it and this one unlocks. The whole course is free, no account needed, and you can read this lesson right now.