17 September 2026
Shared Paint Colour
Medium
Lists
Sets
Find the first paint colour in an artist palette that is available in a shared cabinet.
You are given an artist's palette, listed in the order the artist would like to use the colours, and a list of colours currently available in a shared cabinet. Look through the palette from left to right. Find the first colour that also appears in the available list. Return that colour. If no palette colour is available, return an empty string.
Constraints
palette and available each contain from 0 to 1,000 uppercase or lowercase ASCII colour namesEach colour name has from 1 to 30 charactersMatching is case-sensitive
Function signature
def first_shared_colour(palette, available):