Company: Walmart
Difficulty: medium
Sort Real Number Strings You are given a list of strings. Each string represents a real number and may be positive or negative, and may contain a decimal point. Sort the strings by their numeric values without converting the full string to an arithmetic numeric data type (no int , long , float , double , BigInteger , BigDecimal , Fraction or equivalent applied to the number as a whole). Compare the strings by inspecting their sign, integer part and fractional part directly. Return the sorted list of the original strings, unchanged. If two strings represent the same numeric value, keep their original relative order. Function sortRealNumberStrings(numbers: String[]) -> String[] Input format The first line contains a single integer n , the number of strings. Each of the next n lines contains one string numbers[i] . Output format Print n lines: the strings in sorted order, one per line, exactly as they appeared in the input. Constraints 1 <= n <= 1000 Each numbers[i] has length be