7 kyu

Bob's Short Forms

609 of 1,451codeo

Description:

Bob is a theoretical coder - he doesn't write code, but comes up with theories, formulas and algorithm ideas. You are his secretary, and he has tasked you with writing the code for his newest project - a method for making the short form of a word. Write a function shortForm(C# ShortForm, Python short_form) that takes a string and returns it converted into short form using the rule: Remove all vowels, except for those that are the first or last letter. Do not count 'y' as a vowel, and ignore case. Also note, the string given will not have any spaces; only one word, and only Roman letters.
Example:

shortForm("assault");
short_form("assault")
ShortForm("assault");
// should return "asslt"



Also, FYI: I got all the words with no vowels from
https://en.wikipedia.org/wiki/English_words_without_vowels

Strings
Regular Expressions
Algorithms
Fundamentals

Stats:

CreatedApr 12, 2016
PublishedApr 12, 2016
Warriors Trained1960
Total Skips18
Total Code Submissions5111
Total Times Completed1451
JavaScript Completions609
Python Completions651
C# Completions241
Total Stars35
% of votes with a positive feedback rating92% of 284
Total "Very Satisfied" Votes243
Total "Somewhat Satisfied" Votes34
Total "Not Satisfied" Votes7
Ad
Contributors
  • codeo Avatar
  • myjinxin2015 Avatar
  • donaldsebleung Avatar
  • hobovsky Avatar
  • farhanaditya Avatar
  • saudiGuy Avatar
Ad