package
0.0.0-20240615115840-a222ecda5fb5
Repository: https://github.com/koykov/algoexpert.io.git
Documentation: pkg.go.dev
# README
Common Characters
Category: Strings
Difficulty: Easy
Description
Write a function that takes in a non-empty list of non-empty strings and returns a list of characters that are common to all strings in the list, ignoring multiplicity.
Note that the strings are not guaranteed to only contain alphanumeric characters. The list you return can be in any order.
Sample Input
strings = ["abc", "bcd", "cbaccd"]
Sample Output
["b", "c"] // The characters could be ordered differently.
Optimal Space & Time Complexity
O(n * m) time | O(m) space - where n is the number of strings, and m is the length of the longest string