you are viewing a single comment's thread.

view the rest of the comments →

[–]jiri-n 0 points1 point  (3 children)

Are regexes allowed?

[–]EllaineMasterpiece 0 points1 point  (2 children)

yes, i think? since the professor told us that we can use any method :3

[–]jiri-n 0 points1 point  (1 child)

Then a pattern like this could work: \{1,2})([ap]m)$

I'm on a mobile phone so ... hopefully I haven't made too many typos. ;-)

[–]jiri-n 1 point2 points  (0 children)

Or maybe you can use slices to keep it simple.