6 kyu
String Evaluation
241 of 494sataman
Description:
Evaluate the given string with the given conditons.
The conditions will be passed in an array and will be formatted like this:
{symbol or digit}{comparison operator}{symbol or digit}
Return the results in an array.
The characters in the conditions will always be in the string. Characters in the string are chosen from ascii letters + @#$%^&*()_{}[]
Example
input string: "aab#HcCcc##l#"
conditions: ["a<b", "#==4", "c>=C", "H!=a"]
The conditions in this example array can be interpreted as:
"a<b"
: The number of times"a"
occurs in the string should be less than the number of times"b"
occurs in the string"#==4"
:"#"
should occur exactly 4 times in the string"c>=C"
:"c"
should occur greater than or equal to the number of times"C"
occurs"H!=a"
: The number of times"H"
occurs should not equal the number of times"a"
occurs
In this example condition 1 is false
and 2, 3, 4 are true
. So the return value will be an array as such:
[False, True, True, True]
Strings
Algorithms
Similar Kata:
Stats:
Created | Oct 5, 2016 |
Published | Oct 5, 2016 |
Warriors Trained | 946 |
Total Skips | 30 |
Total Code Submissions | 3855 |
Total Times Completed | 494 |
Python Completions | 241 |
JavaScript Completions | 268 |
Total Stars | 27 |
% of votes with a positive feedback rating | 91% of 150 |
Total "Very Satisfied" Votes | 127 |
Total "Somewhat Satisfied" Votes | 18 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 9 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |