Company: Uber_She ++_17_jan
Difficulty: medium
Valid Ride Code Partitions Problem Description Uber assigns a unique rideCode to each completed trip. This code is represented as a numeric string. To ensure security and fraud prevention, the system needs to evaluate the number of valid ways the rideCode can be partitioned into secure tokens. Each secure token must meet the following conditions: It must represent a prime number between 2 and 10 6 (inclusive). It must not have leading zeros. All digits of the rideCode must be used in the partition. The digits must remain in their original order. Since the number of valid partitions may be very large, return the result modulo (10 9 + 7). Examples Example 1 Input: rideCode = "11375" Output: 3 Explanation: The partitions are: [11, 37, 5] [11, 3, 7, 5] [113, 7, 5] Example 2 Input: rideCode = "235711" Output: 5 Explanation: Valid partitions include: [2, 3, 5, 7, 11] [23, 5, 7, 11] [2, 3, 571] [2, 3571, 1] (invalid, 1 is not prime - excluded) [2357, 11] [2, 353, 11] Counting the valid ones,