#1002

Find Common Characters

newbie · 240 · lc easy +18 · verified · 74.7% accepted · 4,509 likes · top 85%

Description

Given a string array words, return an array of every character (counting duplicates) that appears in all strings in words. The answer can be in any order.

Example 1:

Input: words = ["bella","label","roller"]
Output: ["e","l","l"]

Example 2:

Input: words = ["cool","lock","cook"]
Output: ["c","o"]

Code

1
2
3