Description
Solutions
Create New Version
🤘 INTERN

Create a new version of the given string by following the given rules.

Note

The digits in the input string can be negative, in which case you will append the current output string once to the output. If you encounter 0 or 1, do not append anything to the current output.

𓈒ㅤׂㅤ𓇼 ࣪ 𓈒ㅤׂㅤCredit to Charlotte⭒ 𓆡 ⭒ㅤ𓈒ㅤׂ 🫧

Example 1:

Input:  s = "cisco"
Output: "cisco"
Explanation:

The given string is "cisco" and contains all letters so add it to the output string (using rule number 1). So, the output will be "cisco".

Example 2:

Input:  s = "cisco2india"
Output: "ciscociscoindia"
Explanation:

The given string is "cisco2india" which contains one digit '2' after "cisco" so by using rule number 2, we get "ciscocisco" and the remaining substring "india" it is added to the output string using rule number 1. So, the output is "ciscociscoindia".

Constraints:
    🍅🍅
Thumbnail 0
Testcase

Result
Case 1

input:

output: