Skip to content
← Back to the archive

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 names
  • Each colour name has from 1 to 30 characters
  • Matching is case-sensitive

Function signature

def first_shared_colour(palette, available):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.