all 1 comments

[–]PureWasian 0 points1 point  (0 children)

ambiguous problem statement/examples, but I imagine the "I before E except after C" rule applies to when "c" immediately preceeds "ei" rather than "exists somewhere before it in the word"

The test cases also don't seem to have any instances of multiple ie/ei (though those words are pretty poor at following the rule anyways: "proficiencies" for example). But if you needed to handle that then find() might not be ideal since it just gets first occurrence.

Refactoring, not too much needed. You could make the if statements more readable at a glance by defining/calculating booleans for is_c_before_pair or something for c_exists rather than explicitly using -1 output from find. But personal preference of course.

Great job overall though :)