user: # Hey You !

Sort these integers for me ...

By name ...

Do it now !


---

## Input

* Range is ```0```-```999```

* There may be duplicates

* The array may be empty

## Example

* Input: 1, 2, 3, 4
* Equivalent names: "one", "two", "three", "four"
* Sorted by name: "four", "one", "three", "two"
* Output: 4, 1, 3, 2

## Notes
* Don't pack words together:
 * e.g. 99 may be "ninety nine" or "ninety-nine"; but not "ninetynine"
 * e.g 101 may be "one hundred one" or "one hundred and one"; but not "onehundredone"
* Don't fret about formatting rules, because if rules are consistently applied it has no effect anyway:
 * e.g. "one hundred one", "one hundred two"; is same order as "one hundred **and** one", "one hundred **and** two"
 * e.g. "ninety eight", "ninety nine"; is same order as "ninety-eight", "ninety-nine"
 
```if:c
* For `C` code the input array may be NULL. The return value is freed if non-NULL.
```

Answer: {"fn_name": "sort_by_name", "inputs": [[[0, 1, 2, 3]], [[]], [[8, 8, 9, 9, 10, 10]], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]], [[99, 100, 200, 300, 999]], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999]]], "outputs": [[[1, 3, 2, 0]], [[]], [[8, 8, 9, 9, 10, 10]], [[8, 18, 11, 15, 5, 4, 14, 9, 19, 1, 7, 17, 6, 16, 10, 13, 3, 12, 20, 2, 0]], [[999, 99, 100, 300, 200]], [[8, 800, 808, 818, 880, 888, 885, 884, 889, 881, 887, 886, 883, 882, 811, 815, 850, 858, 855, 854, 859, 851, 857, 856, 853, 852, 805, 840, 848, 845, 844, 849, 841, 847, 846, 843, 842, 804, 814, 809, 819, 890, 898, 895, 894, 899, 891, 897, 896, 893, 892, 801, 807, 817, 870, 878, 875, 874, 879, 871, 877, 876, 873, 872, 806, 816, 860, 868, 865, 864, 869, 861, 867, 866, 863, 862, 810, 813, 830, 838, 835, 834, 839, 831, 837, 836, 833, 832, 803, 812, 820, 828, 825, 824, 829, 821, 827, 826, 823, 822, 802, 18, 80, 88, 85, 84, 89, 81, 87, 86, 83, 82, 11, 15, 50, 58, 55, 54, 59, 51, 57, 56, 53, 52, 5, 500, 508, 518, 580, 588, 585, 584, 589, 581, 587, 586, 583, 582, 511, 515, 550, 558, 555, 554, 559, 551, 557, 556, 553, 552, 505, 540, 548, 545, 544, 549, 541, 547, 546, 543, 542, 504, 514, 509, 519, 590, 598, 595, 594, 599, 591, 597, 596, 593, 592, 501, 507, 517, 570, 578, 575, 574, 579, 571, 577, 576, 573, 572, 506, 516, 560, 568, 565, 564, 569, 561, 567, 566, 563, 562, 510, 513, 530, 538, 535, 534, 539, 531, 537, 536, 533, 532, 503, 512, 520, 528, 525, 524, 529, 521, 527, 526, 523, 522, 502, 40, 48, 45, 44, 49, 41, 47, 46, 43, 42, 4, 400, 408, 418, 480, 488, 485, 484, 489, 481, 487, 486, 483, 482, 411, 415, 450, 458, 455, 454, 459, 451, 457, 456, 453, 452, 405, 440, 448, 445, 444, 449, 441, 447, 446, 443, 442, 404, 414, 409, 419, 490, 498, 495, 494, 499, 491, 497, 496, 493, 492, 401, 407, 417, 470, 478, 475, 474, 479, 471, 477, 476, 473, 472, 406, 416, 460, 468, 465, 464, 469, 461, 467, 466, 463, 462, 410, 413, 430, 438, 435, 434, 439, 431, 437, 436, 433, 432, 403, 412, 420, 428, 425, 424, 429, 421, 427, 426, 423, 422, 402, 14, 9, 900, 908, 918, 980, 988, 985, 984, 989, 981, 987, 986, 983, 982, 911, 915, 950, 958, 955, 954, 959, 951, 957, 956, 953, 952, 905, 940, 948, 945, 944, 949, 941, 947, 946, 943, 942, 904, 914, 909, 919, 990, 998, 995, 994, 999, 991, 997, 996, 993, 992, 901, 907, 917, 970, 978, 975, 974, 979, 971, 977, 976, 973, 972, 906, 916, 960, 968, 965, 964, 969, 961, 967, 966, 963, 962, 910, 913, 930, 938, 935, 934, 939, 931, 937, 936, 933, 932, 903, 912, 920, 928, 925, 924, 929, 921, 927, 926, 923, 922, 902, 19, 90, 98, 95, 94, 99, 91, 97, 96, 93, 92, 1, 100, 108, 118, 180, 188, 185, 184, 189, 181, 187, 186, 183, 182, 111, 115, 150, 158, 155, 154, 159, 151, 157, 156, 153, 152, 105, 140, 148, 145, 144, 149, 141, 147, 146, 143, 142, 104, 114, 109, 119, 190, 198, 195, 194, 199, 191, 197, 196, 193, 192, 101, 107, 117, 170, 178, 175, 174, 179, 171, 177, 176, 173, 172, 106, 116, 160, 168, 165, 164, 169, 161, 167, 166, 163, 162, 110, 113, 130, 138, 135, 134, 139, 131, 137, 136, 133, 132, 103, 112, 120, 128, 125, 124, 129, 121, 127, 126, 123, 122, 102, 7, 700, 708, 718, 780, 788, 785, 784, 789, 781, 787, 786, 783, 782, 711, 715, 750, 758, 755, 754, 759, 751, 757, 756, 753, 752, 705, 740, 748, 745, 744, 749, 741, 747, 746, 743, 742, 704, 714, 709, 719, 790, 798, 795, 794, 799, 791, 797, 796, 793, 792, 701, 707, 717, 770, 778, 775, 774, 779, 771, 777, 776, 773, 772, 706, 716, 760, 768, 765, 764, 769, 761, 767, 766, 763, 762, 710, 713, 730, 738, 735, 734, 739, 731, 737, 736, 733, 732, 703, 712, 720, 728, 725, 724, 729, 721, 727, 726, 723, 722, 702, 17, 70, 78, 75, 74, 79, 71, 77, 76, 73, 72, 6, 600, 608, 618, 680, 688, 685, 684, 689, 681, 687, 686, 683, 682, 611, 615, 650, 658, 655, 654, 659, 651, 657, 656, 653, 652, 605, 640, 648, 645, 644, 649, 641, 647, 646, 643, 642, 604, 614, 609, 619, 690, 698, 695, 694, 699, 691, 697, 696, 693, 692, 601, 607, 617, 670, 678, 675, 674, 679, 671, 677, 676, 673, 672, 606, 616, 660, 668, 665, 664, 669, 661, 667, 666, 663, 662, 610, 613, 630, 638, 635, 634, 639, 631, 637, 636, 633, 632, 603, 612, 620, 628, 625, 624, 629, 621, 627, 626, 623, 622, 602, 16, 60, 68, 65, 64, 69, 61, 67, 66, 63, 62, 10, 13, 30, 38, 35, 34, 39, 31, 37, 36, 33, 32, 3, 300, 308, 318, 380, 388, 385, 384, 389, 381, 387, 386, 383, 382, 311, 315, 350, 358, 355, 354, 359, 351, 357, 356, 353, 352, 305, 340, 348, 345, 344, 349, 341, 347, 346, 343, 342, 304, 314, 309, 319, 390, 398, 395, 394, 399, 391, 397, 396, 393, 392, 301, 307, 317, 370, 378, 375, 374, 379, 371, 377, 376, 373, 372, 306, 316, 360, 368, 365, 364, 369, 361, 367, 366, 363, 362, 310, 313, 330, 338, 335, 334, 339, 331, 337, 336, 333, 332, 303, 312, 320, 328, 325, 324, 329, 321, 327, 326, 323, 322, 302, 12, 20, 28, 25, 24, 29, 21, 27, 26, 23, 22, 2, 200, 208, 218, 280, 288, 285, 284, 289, 281, 287, 286, 283, 282, 211, 215, 250, 258, 255, 254, 259, 251, 257, 256, 253, 252, 205, 240, 248, 245, 244, 249, 241, 247, 246, 243, 242, 204, 214, 209, 219, 290, 298, 295, 294, 299, 291, 297, 296, 293, 292, 201, 207, 217, 270, 278, 275, 274, 279, 271, 277, 276, 273, 272, 206, 216, 260, 268, 265, 264, 269, 261, 267, 266, 263, 262, 210, 213, 230, 238, 235, 234, 239, 231, 237, 236, 233, 232, 203, 212, 220, 228, 225, 224, 229, 221, 227, 226, 223, 222, 202, 0]]]}