FPEvalDataset/LeetCodeProblem
0305
1{2 "id": 3416,3 "name": "sum_of_digit_differences_of_all_pairs",4 "difficulty": "Medium",5 "link": "https://leetcode.com/problems/sum-of-digit-differences-of-all-pairs/",6 "date": "2024-05-12 00:00:00",7 "task_description": "You are given an array `nums` consisting of **positive** integers where all integers have the **same** number of digits. The **digit difference** between two integers is the _count_ of different digits that are in the **same** position in the two integers. Return the **sum** of the **digit differences** between **all** pairs of integers in `nums`. **Example 1:** **Input:** nums = [13,23,12] **Output:** 4 **Explanation:** We have the following: - The digit difference between **1**3 and **2**3 is 1. - The digit difference between 1**3** and 1**2** is 1. - The digit difference between **23** and **12** is 2. So the total sum of digit differences between all pairs of integers is `1 + 1 + 2 = 4`. **Example 2:** **Input:** nums = [10,10,10,10] **Output:** 0 **Explanation:** All the integers in the array are the same. So the total sum of digit differences between all pairs of integers will be 0. **Constraints:** `2 <= nums.length <= 105` `1 <= nums[i] < 109` All integers in `nums` have the same number of digits.",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums = [13,23,12]",12 "output": "4 "13 },14 {15 "label": "Example 2",16 "input": "nums = [10,10,10,10]",17 "output": "0 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 221,24 458,25 410,26 326,27 358,28 352,29 155,30 402,31 616,32 364,33 372,34 233,35 669,36 665,37 584,38 621,39 706,40 811,41 713,42 472,43 759,44 728,45 585,46 508,47 916,48 442,49 762,50 983,51 437,52 424,53 673,54 913,55 638,56 641,57 413,58 621,59 225,60 914,61 621,62 268,63 907,64 834,65 612,66 638,67 950,68 250,69 324,70 337,71 535,72 914,73 421,74 501,75 182,76 762,77 519,78 835,79 408,80 946,81 944,82 802,83 459,84 619,85 939,86 580,87 656,88 693,89 959,90 299,91 618,92 285,93 905,94 721,95 703,96 910,97 418,98 227,99 339,100 233,101 927,102 770,103 986,104 719,105 107,106 107,107 949,108 923,109 210,110 349,111 712,112 579,113 889,114 745,115 427,116 495,117 199,118 869,119 182,120 952,121 390,122 934,123 404,124 929,125 325,126 988,127 605,128 516,129 583,130 783,131 786,132 709,133 232,134 881,135 838,136 659,137 404,138 416,139 640,140 950,141 639,142 772,143 951,144 748,145 958,146 478,147 540,148 673,149 142,150 368,151 784,152 714,153 779,154 785,155 171,156 703,157 378,158 311,159 715,160 469,161 238,162 741,163 839,164 888,165 895,166 543,167 325,168 510,169 583,170 313,171 310,172 168,173 278,174 907,175 103,176 747,177 335,178 400,179 150,180 867,181 421,182 854,183 614,184 433,185 422,186 830,187 371,188 203,189 459,190 999,191 112,192 420,193 791,194 907,195 733,196 279,197 753,198 948,199 381,200 388,201 443,202 493,203 445,204 325,205 796,206 269,207 267,208 813,209 609,210 992,211 944,212 164,213 207,214 587,215 773,216 873,217 489,218 932,219 336,220 684,221 367,222 856,223 877,224 789,225 728,226 606,227 692,228 576,229 824,230 215,231 571,232 650,233 205,234 752,235 443,236 830,237 679,238 183,239 183,240 913,241 399,242 995,243 892,244 436,245 525,246 498,247 872,248 789,249 475,250 378,251 413,252 564,253 708,254 893,255 961,256 183,257 272,258 102,259 890,260 183,261 375,262 560,263 614,264 429,265 496,266 231,267 763,268 465,269 674,270 124,271 779,272 290,273 649,274 641,275 170,276 749,277 741,278 459,279 337,280 702,281 510,282 296,283 521,284 183,285 860,286 703,287 286,288 171,289 136,290 691,291 901,292 843,293 757,294 396,295 124,296 740,297 790,298 586,299 311,300 523,301 705,302 370,303 307,304 509,305 792,306 977,307 875,308 551,309 641,310 891,311 918,312 779,313 438,314 682,315 258,316 596,317 488,318 296,319 171,320 104,321 819,322 722,323 862,324 282,325 258,326 571,327 531,328 114,329 246,330 401,331 190,332 129,333 258,334 334,335 933,336 845,337 845,338 929,339 325,340 842,341 783,342 929,343 356,344 557,345 860,346 481,347 379,348 355,349 454,350 238,351 283,352 512,353 654,354 720,355 213,356 956,357 729,358 588,359 846,360 224,361 785,362 300,363 403,364 957,365 867,366 219,367 787,368 657,369 349,370 335,371 383,372 414,373 293,374 797,375 270,376 425,377 239,378 487,379 188,380 443,381 794,382 204,383 302,384 727,385 962,386 548,387 762,388 873,389 931,390 952,391 733,392 131,393 757,394 586,395 907,396 167,397 107,398 175,399 546,400 987,401 940,402 996,403 523,404 173,405 747,406 516,407 939,408 785,409 164,410 550,411 461,412 487,413 710,414 967,415 309,416 992,417 463,418 394,419 905,420 536,421 321,422 457,423 894,424 496,425 531,426 548,427 323,428 511,429 997,430 978,431 696,432 687,433 898,434 716,435 449,436 679,437 335,438 271,439 753,440 402,441 286,442 648,443 285,444 260,445 303,446 481,447 232,448 956,449 925,450 986,451 666,452 950,453 555,454 667,455 340,456 818,457 544,458 384,459 991,460 232,461 250,462 577,463 884,464 964,465 228,466 695,467 157,468 836,469 170,470 248,471 491,472 187,473 508,474 410,475 209,476 543,477 950,478 492,479 162,480 198,481 469,482 457,483 237,484 965,485 500,486 385,487 796,488 824,489 878,490 103,491 937,492 414,493 448,494 432,495 443,496 813,497 726,498 212,499 872,500 462,501 308,502 746,503 207,504 750,505 336,506 859,507 538,508 366,509 264,510 266,511 720,512 314,513 143,514 907,515 452,516 766,517 798,518 905,519 434,520 648,521 653,522 448,523 349,524 188,525 346,526 414,527 191,528 998,529 427,530 139,531 444,532 686,533 203,534 785,535 660,536 223,537 394,538 911,539 149,540 680,541 763,542 538,543 274,544 573,545 262,546 142,547 303,548 131,549 126,550 697,551 491,552 194,553 166,554 513,555 775,556 662,557 121,558 810,559 716,560 326,561 821,562 642,563 322,564 983,565 788,566 552,567 848,568 386,569 795,570 835,571 685,572 891,573 182,574 138,575 156,576 375,577 471,578 689,579 844,580 402,581 247,582 566,583 352,584 692,585 477,586 295,587 448,588 337,589 964,590 334,591 520,592 276,593 213,594 582,595 278,596 745,597 629,598 393,599 824,600 382,601 972,602 780,603 650,604 541,605 850,606 873,607 548,608 256,609 372,610 620,611 498,612 476,613 571,614 304,615 176,616 442,617 509,618 293,619 945,620 436,621 358,622 636,623 713,624 479,625 679,626 396,627 227,628 764,629 577,630 809,631 222,632 452,633 288,634 342,635 702,636 739,637 255,638 998,639 901,640 683,641 288,642 487,643 789,644 701,645 762,646 404,647 586,648 828,649 849,650 809,651 314,652 493,653 303,654 115,655 124,656 214,657 743,658 464,659 264,660 310,661 100,662 399,663 937,664 437,665 843,666 652,667 693,668 732,669 931,670 668,671 655,672 932,673 883,674 507,675 993,676 726,677 391,678 348,679 753,680 218,681 121,682 773,683 683,684 635,685 901,686 872,687 204,688 325,689 609,690 410,691 785,692 295,693 213,694 749,695 163,696 525,697 890,698 495,699 774,700 101,701 364,702 855,703 326,704 129,705 430,706 630,707 373,708 999,709 442,710 997,711 964,712 818,713 601,714 540,715 423,716 836,717 101,718 439,719 611,720 477,721 784,722 995,723 896,724 665,725 240,726 636,727 748,728 568,729 459,730 595,731 988,732 651,733 990,734 387,735 182,736 816,737 988,738 684,739 912,740 234,741 125,742 367,743 860,744 314,745 871,746 689,747 648,748 755,749 826,750 273,751 255,752 334,753 880,754 789,755 391,756 294,757 947,758 554,759 163,760 811,761 269,762 599,763 693,764 803,765 689,766 425,767 101,768 853,769 602,770 752,771 338,772 148,773 874,774 805,775 760,776 350,777 895,778 259,779 681,780 492,781 502,782 854,783 633,784 771,785 458,786 985,787 874,788 777,789 574,790 147,791 779,792 855,793 913,794 642,795 521,796 140,797 342,798 979,799 699,800 223,801 947,802 835,803 589,804 853,805 161,806 771,807 101,808 400,809 873,810 457,811 304,812 279,813 970,814 252,815 634,816 783,817 401,818 205,819 638,820 952,821 389,822 433,823 781,824 279,825 553,826 772,827 525,828 939,829 499,830 882,831 745,832 826,833 808,834 295,835 717,836 118,837 449,838 618,839 507,840 169,841 937,842 371,843 420,844 875,845 864,846 964,847 519,848 891,849 282,850 808,851 475,852 196,853 381,854 675,855 717,856 276,857 170,858 511,859 618,860 411,861 869,862 811,863 668,864 294,865 515,866 955,867 763,868 437,869 686,870 876,871 225,872 137,873 324,874 832,875 782,876 879,877 534,878 142,879 421,880 327,881 277,882 817,883 690,884 502,885 458,886 524,887 443,888 816,889 420,890 505,891 287,892 826,893 601,894 562,895 978,896 463,897 117,898 964,899 731,900 767,901 572,902 833,903 740,904 114,905 791,906 884,907 515,908 220,909 320,910 280,911 466,912 324,913 453,914 970,915 422,916 348,917 627,918 481,919 427,920 692,921 334,922 870,923 191,924 872,925 353,926 304,927 450,928 771,929 455,930 752,931 267,932 738,933 992,934 549,935 911,936 311,937 348,938 303,939 723,940 402,941 752,942 718,943 931,944 191,945 536,946 452,947 490,948 860,949 582,950 637,951 160,952 262,953 889,954 349,955 999,956 355,957 869,958 765,959 843,960 158,961 259,962 292,963 739,964 241,965 732,966 527,967 516,968 834,969 818,970 299,971 439,972 458,973 331,974 521,975 295,976 433,977 100,978 235,979 472,980 617,981 250,982 676,983 646,984 157,985 334,986 726,987 695,988 792,989 265,990 211,991 404,992 297,993 230,994 110,995 233,996 552,997 127,998 568,999 422,1000 535,1001 994,1002 891,1003 108,1004 596,1005 732,1006 191,1007 356,1008 321,1009 177,1010 340,1011 690,1012 720,1013 395,1014 666,1015 917,1016 910,1017 514,1018 837,1019 876,1020 373,1021 940,1022 368,1023 495,1024 118,1025 601,1026 180,1027 831,1028 696,1029 795,1030 596,1031 186,1032 278,1033 502,1034 120,1035 966,1036 675,1037 897,1038 680,1039 141,1040 681,1041 780,1042 159,1043 808,1044 641,1045 196,1046 772,1047 165,1048 302,1049 325,1050 925,1051 859,1052 414,1053 566,1054 133,1055 323,1056 286,1057 216,1058 139,1059 838,1060 190,1061 985,1062 857,1063 904,1064 580,1065 651,1066 582,1067 720,1068 935,1069 182,1070 184,1071 502,1072 596,1073 575,1074 520,1075 210,1076 646,1077 521,1078 857,1079 745,1080 224,1081 608,1082 922,1083 820,1084 608,1085 478,1086 980,1087 601,1088 845,1089 595,1090 578,1091 983,1092 122,1093 714,1094 364,1095 938,1096 490,1097 745,1098 695,1099 105,1100 696,1101 966,1102 233,1103 983,1104 141,1105 748,1106 725,1107 227,1108 833,1109 125,1110 375,1111 325,1112 593,1113 828,1114 953,1115 464,1116 892,1117 763,1118 686,1119 558,1120 919,1121 567,1122 706,1123 260,1124 532,1125 783,1126 964,1127 264,1128 877,1129 556,1130 501,1131 816,1132 774,1133 223,1134 839,1135 644,1136 283,1137 449,1138 935,1139 993,1140 864,1141 110,1142 758,1143 442,1144 560,1145 989,1146 194,1147 875,1148 273,1149 783,1150 331,1151 197,1152 310,1153 321,1154 117,1155 588,1156 132,1157 628,1158 283,1159 377,1160 246,1161 420,1162 405,1163 755,1164 605,1165 713,1166 735,1167 946,1168 796,1169 983,1170 408,1171 443,1172 306,1173 713,1174 633,1175 112,1176 168,1177 802,1178 188,1179 622,1180 306,1181 139,1182 851,1183 555,1184 666,1185 874,1186 379,1187 650,1188 340,1189 819,1190 661,1191 886,1192 233,1193 965,1194 583,1195 599,1196 689,1197 728,1198 981,1199 811,1200 485,