Company: Epam Ai native software engineer Oncampus_15july
Difficulty: medium
You are given a string s consisting of digits. Your task is to determine how many valid partitions can be formed from the string, where each partition is a number between 1 and 26 (inclusive). For example, the string "12" can be split into: The number 12 Or split into two digits 1 and 2 The valid numbers are those between 1 and 26, inclusive. Hence "12" is valid, but "27" would not be valid. Rules You are allowed to split the string into multiple partitions, and each partition must form a valid number between 1 and 26. A number that starts with a leading zero (e.g. "01", "02") is not valid unless it forms "10" or "20". In other words "01" is not valid, but "10" is valid. If any partition starts with a '0' (unless it is part of "10" or "20"), it should be considered invalid. Your task is to determine how many valid partitions you can form from the string s . Input Format The first line contains an integer n , representing the length of the string s . The second line contains the string