You need to sign in or sign up before continuing.×
7 kyu
Hungarian Vowel Harmony (easy)
1,238 of 3,631suic
Description:
Vowel harmony is a phenomenon in some languages. It means that "A vowel or vowels in a word are changed to sound the same (thus "in harmony.")" (wikipedia). This kata is based on vowel harmony in Hungarian.
Task:
Your goal is to create a function dative()
(Dative()
in C#) which returns the valid form of a valid Hungarian word w
in dative case i. e. append the correct suffix nek
or nak
to the word w
based on vowel harmony rules.
Vowel Harmony Rules (simplified)
When the last vowel in the word is
- a front vowel (
e, é, i, í, ö, ő, ü, ű
) the suffix is-nek
- a back vowel (
a, á, o, ó, u, ú
) the suffix is-nak
Examples:
dative("ablak") == "ablaknak"
dative("szék") == "széknek"
dative("otthon") == "otthonnak"
Preconditions:
- To keep it simple: All words end with a consonant :)
- All strings are unicode strings.
- There are no grammatical exceptions in the tests.
Strings
Fundamentals
Similar Kata:
Stats:
Created | Oct 11, 2016 |
Published | Oct 12, 2016 |
Warriors Trained | 6676 |
Total Skips | 284 |
Total Code Submissions | 13232 |
Total Times Completed | 3631 |
Python Completions | 1238 |
C# Completions | 284 |
JavaScript Completions | 1156 |
Haskell Completions | 81 |
PHP Completions | 127 |
Groovy Completions | 46 |
Scala Completions | 70 |
Java Completions | 394 |
Ruby Completions | 110 |
CoffeeScript Completions | 9 |
TypeScript Completions | 85 |
Go Completions | 124 |
Rust Completions | 73 |
Total Stars | 76 |
% of votes with a positive feedback rating | 90% of 656 |
Total "Very Satisfied" Votes | 543 |
Total "Somewhat Satisfied" Votes | 99 |
Total "Not Satisfied" Votes | 14 |
Total Rank Assessments | 10 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |