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