7 kyu

Tail Swap

2,252 of 5,357mkelty

Description:

You'll be given a list of two strings, and each will contain exactly one colon (":") in the middle (but not at beginning or end). The length of the strings, before and after the colon, are random.

Your job is to return a list of two strings (in the same order as the original list), but with the characters after each colon swapped.

Examples

["abc:123", "cde:456"]  -->  ["abc:456", "cde:123"]
["a:12345", "777:xyz"]  -->  ["a:xyz", "777:12345"]
Fundamentals

More By Author:

Check out these other kata created by mkelty

Stats:

CreatedJan 1, 2017
PublishedJan 1, 2017
Warriors Trained7590
Total Skips119
Total Code Submissions12915
Total Times Completed5357
Python Completions2252
Haskell Completions130
JavaScript Completions2417
CoffeeScript Completions11
PHP Completions264
Ruby Completions117
TypeScript Completions207
C# Completions151
C Completions23
Total Stars57
% of votes with a positive feedback rating92% of 884
Total "Very Satisfied" Votes763
Total "Somewhat Satisfied" Votes104
Total "Not Satisfied" Votes17
Total Rank Assessments13
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • mkelty Avatar
  • Javatlacati Avatar
  • SagePtr Avatar
  • suic Avatar
  • anter69 Avatar
  • donaldsebleung Avatar
  • St3f4n Avatar
  • Voile Avatar
  • Avanta Avatar
  • FArekkusu Avatar
  • a.kozhanov Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • mauro-1 Avatar
Ad