Menu
Coddy logo textTech

Practice #2

Lesson 10 of 11 in Coddy's Sets in Python course.

challenge icon

Challenge

Easy

Write a function common_elements that takes two arrays as input and returns a list containing elements that are present in both arrays, ordered in ascending order.

Use sets for that!

Try it yourself

def common_elements(arr1, arr2):
    # Write code here

All lessons in Sets in Python