7 kyu

Tail Swap

2,237 of 5,329mkelty

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 Trained7551
Total Skips118
Total Code Submissions12849
Total Times Completed5329
Python Completions2237
Haskell Completions129
JavaScript Completions2408
CoffeeScript Completions11
PHP Completions262
Ruby Completions115
TypeScript Completions205
C# Completions149
C Completions21
Total Stars56
% of votes with a positive feedback rating92% of 880
Total "Very Satisfied" Votes760
Total "Somewhat Satisfied" Votes103
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