Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 434 Bytes

README.md

File metadata and controls

14 lines (10 loc) · 434 Bytes

TwoToOne

Take 2 strings s1 and s2 including only letters from ato z. Return a new sorted string, the longest possible, containing distinct letters,

each taken only once - coming from s1 or s2. Examples: a = "xyaabbbccccdefww" b = "xxxxyyyyabklmopq" longest(a, b) -> "abcdefklmopqwxy"

a = "abcdefghijklmnopqrstuvwxyz" longest(a, a) -> "abcdefghijklmnopqrstuvwxyz"

Link: https://www.codewars.com/kata/5656b6906de340bd1b0000ac