2633. Convert Object to JSON String
Hints
Hint 1
Consider the 4 possibilities. The object could be an array, an object, a string, or another type.
Hint 2
Think about the problem recursively. If you know how to convert any sub-data into a string, how could you use it to convert the entire data into a string?
Hint 3
If the data is a string, it's just the value surrounded by double quotes. If the data is another type, its just String(data). If the data is an array, it's the recursively stringified value of each item separated by commas. If the data is an object, it's a series of key-value pairs where each value is the recursively stringified value.
Preparing judge…