11/22 String
ABC 381Problem 35 of 50
EasyWhat to do
You need to check if a string made of '1', '2', and '/' is an 11/22 string. An 11/22 string has an odd length, starts with '1's, has a '/' in the middle, and ends with '2's. If it follows these rules, print 'Yes'; otherwise, print 'No'.
Key Concepts
if-statements
string manipulation
length of strings
basic condition checking
Examples
Input:
'11/22'
Output:
Yes
Input:
'/'
Output:
Yes
Tips for Beginners
- Focus on understanding the logic, not memorizing syntax
- Use print statements to debug your code
- Don't worry about input parsing - the function handles that for you
- If stuck, try writing out your solution on paper first
Python Editor
Loading Python...