Siemens Coding Question – Solved

10 Live
You are a part of the World of Wizards—a global society of magicians. It's your task to create a "warped-spell" that helps the society ensure the authenticity and secrecy of its members. All the members meet once a month at a secret club. In order to ensure the authenticity of members, each member is sent a "secret" number of 1-7 digits, 10 days before the meeting. On the meeting day, each member has to present a new "warped" number, which is made by casting a warped-spell on the "secret" received 10 days ago. The "warped" number must have the following magical attributes: 1. Must be strictly 4 - 7 digits in length, i.e., numbers from 1000 to 9999999. 2. Must always be greater than the secret itself. 3. Must have mirror-like characteristics, as shown below:

Asked in: Siemens

Image of the Question

Question Image Question Image

All Testcases Passed ✔



Passcode Image

Solution


Please login to view the solution


Related Questions

| You are given a board of size M × N where each cell can be either empty ('O') o… |
| Undirected Coloured Graph Shortest Path You are given an undirected weight… |
| Village Voyage A computer game "Village Voyage" has N villages (labeled 1 to… |
| Academic Decathlon Students are being selected for an academic decathlon tea… |
| Sum of Arrays Given two arrays each of length n, arr1 and arr2, in one opera… |
| Count Swaps During Custom Sorting Analyze the efficiency of the following so… |