6 kyu

Loneliest character

577 of 1,380aplefull

Description:

Complete the function which accepts a string and returns an array of character(s) that have the most spaces to their right and left.

Notes

  • the string can have leading/trailing spaces - you should not count them
  • the strings contain only unique characters from a to z
  • the order of characters in the returned array doesn't matter

Examples

"a b  c"                        -->  ['b']
"a bcs           d k"           -->  ['d']
"    a b  sc     p     t   k"   -->  ['p']
"a  b  c  de"                   -->  ['b', 'c']
"     a  b  c de        "       -->  ['b']
"abc"                           -->  ['a', 'b', 'c']

Good luck!

Strings
Algorithms

Similar Kata:

Stats:

CreatedOct 15, 2020
PublishedOct 15, 2020
Warriors Trained3909
Total Skips85
Total Code Submissions7389
Total Times Completed1380
JavaScript Completions592
Python Completions577
Ruby Completions56
C# Completions135
Java Completions65
Haskell Completions3
Total Stars100
% of votes with a positive feedback rating94% of 256
Total "Very Satisfied" Votes227
Total "Somewhat Satisfied" Votes26
Total "Not Satisfied" Votes3
Total Rank Assessments4
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • aplefull Avatar
  • anter69 Avatar
  • JohanWiltink Avatar
  • Blind4Basics Avatar
  • hobovsky Avatar
  • topping Avatar
  • Wisdou Avatar
  • RileyHunter Avatar
  • LosBlobbos Avatar
  • saudiGuy Avatar
Ad