Top Coding Interview Question – Solved

4 Live
Format a String Your solution will be scored against multiple hidden test cases, with a sample case provided for your reference. The default code includes a mechanism for reading input strings. You will need to parse these strings into the appropriate variables as needed. The output data type is not a concern, as long as the characters within the output match the expected outcome. Task: Given a string such as "THIS_IS_A_TEST" containing underscores and uppercase characters, write a program to format it into a more human-friendly, readable format. Convert the underscores to spaces. Change the first letter of each word to uppercase. Input: The input consists of a string that may contain letters, underscores, and spaces. Output: Print the formatted string after converting underscores to spaces and capitalizing the first letter of each word. Sample Input: THIS_IS A_TEST Sample Output: This Is A Test

Asked in: No companies listed

Image of the Question

Question Image Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| As an operations engineer at Amazon, you are responsible for organizing the dis… |
| Amazon Books is a retail store that sells the newly launched novel "The Story o… |
| In an Amazon analytics team, the Analysts collectively have a preference for th… |
| AWS provides scalable systems. A set of n servers are used for horizontally sca… |
| A foundry in Hackerland makes an alloy out of n different metals. In the manufa… |
| An array of integers is almost sorted if at most one element can be deleted fro… |