Many beginners strive to solve given problems, without thinking about efficiency of solution.
Consider such Python code:
data = [int(n) for n in input().split()] max_el = max(data) # count multiplicity of every element in data counting_table = [data.count(i) for i in range(max_el+1)]
This solution seems elegant, but is in fact $O(max(data) \cdot len(data))$, while a solution with $O(len(data))$ is possible.
What heuristics can I teach to detect such code which could be done asymptotically faster? What are the most illustrative examples of how a poorly-crafted algorithm which can't tackle a bit more data than anticipated?