Encryption

Company: Tech Mahindra-SDE_24may

Difficulty: medium

Problem Statement

1. Encryption Find the number of non-empty encryptable subsequences in S . Since the output can be large, return it modulo 998244353. Notes: The letters can be present in the string one or more times, not necessarily just once. Function description Complete the solve function in the editor below. It has the following parameter(s): Name Type Description S STRING The given string. Return The function must return an INTEGER denoting the number of non-empty encryptable subsequences in S modulo 998244353. Constraints 1 ≤ len(S) ≤ 10^3 Input format for debugging The first line contains a string, S, denoting the given string. Sample Testcases Input Output Output Description code 15 Here, S = "code" All nonempty subsequences are encryptable. So, the answer is 15. vode 11 Here, S = "vode" The encryptable subsequences are {v, o, d, e, vo, ve, od, oe, de, voe, ode} So, the answer is 11. ir _ r 10 Here, S = "ir _ r" The encryptable subsequences are {i, r, _ , r, ir, i _ , rr, ir_ , irr, i_rr