fork download
  1. #! /usr/bin/env python3
  2.  
  3. from functools import reduce
  4. import sys
  5.  
  6. def programming048(*args):
  7. return reduce(lambda s_1, s_2:
  8. s_1 + s_2[reduce(lambda init, cnt:
  9. cnt if s_1[-cnt:] == s_2[:cnt] else init,
  10. range(1, 1 + min([len(i) for i in [s_1, s_2]])),
  11. 0):],
  12. args[1:], args[0])
  13.  
  14. if __name__ == "__main__":
  15. print(programming048(*sys.argv[1:]))
  16.  
  17.  
Runtime error #stdin #stdout #stderr 0.15s 23616KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 15, in <module>
  File "./prog.py", line 12, in programming048
IndexError: tuple index out of range