Retired
Word Patterns (retired)
246 of 785joh_pot
Description:
Write
function wordPattern(pattern, str)
that given a pattern
and a string str
, find if str
follows the same sequence as pattern
.
For example:
wordPattern('abab', 'truck car truck car') === true
wordPattern('aaaa', 'dog dog dog dog') === true
wordPattern('abab', 'apple banana banana apple') === false
wordPattern('aaaa', 'cat cat dog cat') === false
Note: Each letter in the pattern stands for a distinct word
Algorithms
Similar Kata:
Stats:
Created | Oct 22, 2015 |
Warriors Trained | 1469 |
Total Skips | 75 |
Total Code Submissions | 5708 |
Total Times Completed | 785 |
JavaScript Completions | 246 |
C# Completions | 200 |
Ruby Completions | 93 |
Python Completions | 270 |
Total Stars | 52 |
% of votes with a positive feedback rating | 95% of 170 |
Total "Very Satisfied" Votes | 155 |
Total "Somewhat Satisfied" Votes | 14 |
Total "Not Satisfied" Votes | 1 |