Post History
Challenge Given two strings a and b, return the shortest string s so that s starts with a and ends with b. (Inspired by https://chat.stackexchange.com/transcript/message/57816868#57816868 ) Exam...
Question
code-golf
#3: Post edited
- ## Challenge
- Given two strings a and b, return the shortest string s so that s starts with a and ends with b.
- (Inspired by https://chat.stackexchange.com/transcript/message/57816868#57816868 )
- ## Examples
- ```
- 'ABCDEF', 'EFGHI' -> 'ABCDEFGHI'
- 'AAAAAA', 'AAAAAAAA' -> 'AAAAAAAA'
- 'ABC', '123' -> 'ABC123'
'', 'ABCDE', -> 'ABCDE'- 'ABCD', 'ABCD' -> 'ABCD'
- '', '' -> ''
- ```
- Brownie points for beating my 26 in APL.
- ## Challenge
- Given two strings a and b, return the shortest string s so that s starts with a and ends with b.
- (Inspired by https://chat.stackexchange.com/transcript/message/57816868#57816868 )
- ## Examples
- ```
- 'ABCDEF', 'EFGHI' -> 'ABCDEFGHI'
- 'AAAAAA', 'AAAAAAAA' -> 'AAAAAAAA'
- 'ABC', '123' -> 'ABC123'
- '', 'ABCDE' -> 'ABCDE'
- 'ABCD', 'ABCD' -> 'ABCD'
- '', '' -> ''
- ```
- Brownie points for beating my 26 in APL.
#2: Post edited
- ## Challenge
- Given two strings a and b, return the shortest string s so that s starts with a and ends with b.
- (Inspired by https://chat.stackexchange.com/transcript/message/57816868#57816868 )
- ## Examples
- ```
- 'ABCDEF', 'EFGHI' -> 'ABCDEFGHI'
- 'AAAAAA', 'AAAAAAAA' -> 'AAAAAAAA'
- 'ABC', '123' -> 'ABC123'
- '', 'ABCDE', -> 'ABCDE'
- ```
- Brownie points for beating my 26 in APL.
- ## Challenge
- Given two strings a and b, return the shortest string s so that s starts with a and ends with b.
- (Inspired by https://chat.stackexchange.com/transcript/message/57816868#57816868 )
- ## Examples
- ```
- 'ABCDEF', 'EFGHI' -> 'ABCDEFGHI'
- 'AAAAAA', 'AAAAAAAA' -> 'AAAAAAAA'
- 'ABC', '123' -> 'ABC123'
- '', 'ABCDE', -> 'ABCDE'
- 'ABCD', 'ABCD' -> 'ABCD'
- '', '' -> ''
- ```
- Brownie points for beating my 26 in APL.
#1: Initial revision
Merge two strings
## Challenge Given two strings a and b, return the shortest string s so that s starts with a and ends with b. (Inspired by https://chat.stackexchange.com/transcript/message/57816868#57816868 ) ## Examples ``` 'ABCDEF', 'EFGHI' -> 'ABCDEFGHI' 'AAAAAA', 'AAAAAAAA' -> 'AAAAAAAA' 'ABC', '123' -> 'ABC123' '', 'ABCDE', -> 'ABCDE' ``` Brownie points for beating my 26 in APL.