Company: Myntra_7may
Difficulty: medium
Emergency Code Configurations Problem Description Dr. Alex was rushing to the hospital to attend an emergency surgery. In his hurry, he glanced at his pager and read the emergency code, but due to the stress and the motion of the ambulance, he couldn't remember the digits exactly. The code he read was a number, let's call it X. Dr. Alex realized he might have jumbled the sequence of digits in the emergency code. He might have encountered some digits multiple times, but he was certain that the digits he read were part of the real code. For instance, if Dr. Alex read the code 2042, then digits 2, 0, and 4 were definitely part of the original emergency code. The second occurrence of the digit '2' might be a mistake or might be in the original code. Possible original sequences include: 2042 (correct reading), 2402 (jumbled sequence), and 204 (one occurrence of 2). Invalid sequences include: 22042 (too many 2s), 4120 (extra digits), and 0242 (leading 0). Find the total number of possible em