6 kyu

Shortest code: Father and Son

Description:

shortest code: Father and Son
(Code length limit: 120 chars)

This is the challenge version of coding 3min series. If you feel difficult, please complete the simple version

Task

Every uppercase letter is Father, The corresponding lowercase letters is the Son.

Give you a string s, If the father and son both exist, keep them. If it is a separate existence, delete them. Return the result.

For example:

sc("Aab") should return "Aa"

sc("AabBc") should return "AabB"

sc("AaaaAaab") should return "AaaaAaa"(father can have a lot of son)

sc("aAAAaAAb") should return "aAAAaAA"(son also can have a lot of father ;-)

Code length calculation

In javascript, we can't get the user's real code, we can only get the system compiled code. Code length calculation is based the compiled code.

For example:

If you typed sc=x=>x+1
after compile, it will be:sc=function(x){return x+1;}

Series

Puzzles
Games
Restricted

Stats:

CreatedMar 28, 2016
PublishedMar 29, 2016
Warriors Trained418
Total Skips12
Total Code Submissions1601
Total Times Completed222
JavaScript Completions222
Total Stars8
% of votes with a positive feedback rating94% of 81
Total "Very Satisfied" Votes74
Total "Somewhat Satisfied" Votes5
Total "Not Satisfied" Votes2
Ad
Contributors
  • myjinxin2015 Avatar
  • smile67 Avatar
  • kazk Avatar
Ad