Amplify Interview Question

Write a function that accepts two strings, and returns true if string 2 contains all the characters of string 1.

Interview Answer

Anonymous

May 19, 2015

Probably not the prettiest solution that 5 minutes will get you... def compare_strings(string1, string2): return sorted([y for i in range(len(string1.split())) for y in string1.split()[i]]) == sorted([y for i in range(len(string2.split())) for y in string2.split()[i]])