#2937

Make Three Strings Equal

pupil · 480 · lc easy +27 · 44.7% accepted · 322 likes · top 27%

Description

Three strings s1, s2, and s3 are given. In each operation, choose one string and delete its last character. No string may become empty.

Return the minimum number of operations to make all three strings identical, or -1 if it cannot be done.

Code

1
2
3