File size: 448,006 Bytes
00ae020 | 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 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 | [
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 0,
"prompt": "Write a python function to remove first and last occurrence of a given character from the string.",
"code": "def remove_Occ(s,ch): \n for i in range(len(s)): \n if (s[i] == ch): \n s = s[0 : i] + s[i + 1:] \n break\n for i in range(len(s) - 1,-1,-1): \n if (s[i] == ch): \n s = s[0 : i] + s[i + 1:] \n break\n return s ",
"test_imports": [],
"test_list": [
"assert remove_Occ(\"hello\",\"l\") == \"heo\"",
"assert remove_Occ(\"abcda\",\"a\") == \"bcd\"",
"assert remove_Occ(\"PHP\",\"P\") == \"H\""
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"hello\nl\n",
"abcda\na\n",
"PHP\nP\n"
],
"test_output": [
"heo\n",
"bcd\n",
"H\n"
],
"example_input": [
"hello\nl\n",
"abcda\na\n"
],
"example_output": [
"heo\n",
"bcd\n"
],
"question": "Original problem description:\nWrite a python function to remove first and last occurrence of a given character from the string.\nWe have its functional test sample:\nassert remove_Occ(\"hello\",\"l\") == \"heo\"\nassert remove_Occ(\"abcda\",\"a\") == \"bcd\"\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nhello\nl\n\nOutput:\nheo\n\n\nExample 2:\nInput:\nabcda\na\n\nOutput:\nbcd\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 1,
"prompt": "Write a function to sort a given matrix in ascending order according to the sum of its rows.",
"code": "def sort_matrix(M):\n result = sorted(M, key=sum)\n return result",
"test_imports": [],
"test_list": [
"assert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]]",
"assert sort_matrix([[1, 2, 3], [-2, 4, -5], [1, -1, 1]])==[[-2, 4, -5], [1, -1, 1], [1, 2, 3]]",
"assert sort_matrix([[5,8,9],[6,4,3],[2,1,4]])==[[2, 1, 4], [6, 4, 3], [5, 8, 9]]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3\n2 4 5\n1 1 1\n",
"1 2 3\n-2 4 -5\n1 -1 1\n",
"5 8 9\n6 4 3\n2 1 4\n"
],
"test_output": [
"1 1 1\n1 2 3\n2 4 5\n",
"-2 4 -5\n1 -1 1\n1 2 3\n",
"2 1 4\n6 4 3\n5 8 9\n"
],
"example_input": [
"1 2 3\n2 4 5\n1 1 1\n",
"1 2 3\n-2 4 -5\n1 -1 1\n"
],
"example_output": [
"1 1 1\n1 2 3\n2 4 5\n",
"-2 4 -5\n1 -1 1\n1 2 3\n"
],
"question": "Original problem description:\nWrite a function to sort a given matrix in ascending order according to the sum of its rows.\nWe have its functional test sample:\nassert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]]\nassert sort_matrix([[1, 2, 3], [-2, 4, -5], [1, -1, 1]])==[[-2, 4, -5], [1, -1, 1], [1, 2, 3]]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3\n2 4 5\n1 1 1\n\nOutput:\n1 1 1\n1 2 3\n2 4 5\n\n\nExample 2:\nInput:\n1 2 3\n-2 4 -5\n1 -1 1\n\nOutput:\n-2 4 -5\n1 -1 1\n1 2 3\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 2,
"prompt": "Write a python function to find the volume of a triangular prism.",
"code": "def find_Volume(l,b,h) : \n return ((l * b * h) / 2) ",
"test_imports": [],
"test_list": [
"assert find_Volume(10,8,6) == 240",
"assert find_Volume(3,2,2) == 6",
"assert find_Volume(1,2,1) == 1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n8\n6\n",
"3\n2\n2\n",
"1\n2\n1\n"
],
"test_output": [
"240\n",
"6\n",
"1\n"
],
"example_input": [
"10\n8\n6\n",
"3\n2\n2\n"
],
"example_output": [
"240\n",
"6\n"
],
"question": "Original problem description:\nWrite a python function to find the volume of a triangular prism.\nWe have its functional test sample:\nassert find_Volume(10,8,6) == 240\nassert find_Volume(3,2,2) == 6\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n8\n6\n\nOutput:\n240\n\n\nExample 2:\nInput:\n3\n2\n2\n\nOutput:\n6\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 3,
"prompt": "Write a function to that returns true if the input string contains sequences of lowercase letters joined with an underscore and false otherwise.",
"code": "import re\ndef text_lowercase_underscore(text):\n patterns = '^[a-z]+_[a-z]+$'\n if re.search(patterns, text):\n return True\n else:\n return False",
"test_imports": [],
"test_list": [
"assert text_lowercase_underscore(\"aab_cbbbc\")==(True)",
"assert text_lowercase_underscore(\"aab_Abbbc\")==(False)",
"assert text_lowercase_underscore(\"Aaab_abbbc\")==(False)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"aab_cbbbc\n",
"aab_Abbbc\n",
"Aaab_abbbc\n"
],
"test_output": [
"True\n",
"False\n",
"False\n"
],
"example_input": [
"aab_cbbbc\n",
"aab_Abbbc\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to that returns true if the input string contains sequences of lowercase letters joined with an underscore and false otherwise.\nWe have its functional test sample:\nassert text_lowercase_underscore(\"aab_cbbbc\")==(True)\nassert text_lowercase_underscore(\"aab_Abbbc\")==(False)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\naab_cbbbc\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\naab_Abbbc\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 4,
"prompt": "Write a function that returns the perimeter of a square given its side length as input.",
"code": "def square_perimeter(a):\n perimeter=4*a\n return perimeter",
"test_imports": [],
"test_list": [
"assert square_perimeter(10)==40",
"assert square_perimeter(5)==20",
"assert square_perimeter(4)==16"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n",
"5\n",
"4\n"
],
"test_output": [
"40\n",
"20\n",
"16\n"
],
"example_input": [
"10\n",
"5\n"
],
"example_output": [
"40\n",
"20\n"
],
"question": "Original problem description:\nWrite a function that returns the perimeter of a square given its side length as input.\nWe have its functional test sample:\nassert square_perimeter(10)==40\nassert square_perimeter(5)==20\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n\nOutput:\n40\n\n\nExample 2:\nInput:\n5\n\nOutput:\n20\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 5,
"prompt": "Write a function to remove characters from the first string which are present in the second string.",
"code": "NO_OF_CHARS = 256\ndef str_to_list(string): \n\ttemp = [] \n\tfor x in string: \n\t\ttemp.append(x) \n\treturn temp \ndef lst_to_string(List): \n\treturn ''.join(List) \ndef get_char_count_array(string): \n\tcount = [0] * NO_OF_CHARS \n\tfor i in string: \n\t\tcount[ord(i)] += 1\n\treturn count \ndef remove_dirty_chars(string, second_string): \n\tcount = get_char_count_array(second_string) \n\tip_ind = 0\n\tres_ind = 0\n\ttemp = '' \n\tstr_list = str_to_list(string) \n\twhile ip_ind != len(str_list): \n\t\ttemp = str_list[ip_ind] \n\t\tif count[ord(temp)] == 0: \n\t\t\tstr_list[res_ind] = str_list[ip_ind] \n\t\t\tres_ind += 1\n\t\tip_ind+=1\n\treturn lst_to_string(str_list[0:res_ind]) ",
"test_imports": [],
"test_list": [
"assert remove_dirty_chars(\"probasscurve\", \"pros\") == 'bacuve'",
"assert remove_dirty_chars(\"digitalindia\", \"talent\") == 'digiidi'",
"assert remove_dirty_chars(\"exoticmiles\", \"toxic\") == 'emles'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"probasscurve\npros\n",
"digitalindia\ntalent\n",
"exoticmiles\ntoxic\n"
],
"test_output": [
"bacuve\n",
"digiidi\n",
"emles\n"
],
"example_input": [
"probasscurve\npros\n",
"digitalindia\ntalent\n"
],
"example_output": [
"bacuve\n",
"digiidi\n"
],
"question": "Original problem description:\nWrite a function to remove characters from the first string which are present in the second string.\nWe have its functional test sample:\nassert remove_dirty_chars(\"probasscurve\", \"pros\") == 'bacuve'\nassert remove_dirty_chars(\"digitalindia\", \"talent\") == 'digiidi'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nprobasscurve\npros\n\nOutput:\nbacuve\n\n\nExample 2:\nInput:\ndigitalindia\ntalent\n\nOutput:\ndigiidi\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 6,
"prompt": "Write a function to find whether a given array of integers contains any duplicate element.",
"code": "def test_duplicate(arraynums):\n nums_set = set(arraynums) \n return len(arraynums) != len(nums_set) ",
"test_imports": [],
"test_list": [
"assert test_duplicate(([1,2,3,4,5]))==False",
"assert test_duplicate(([1,2,3,4, 4]))==True",
"assert test_duplicate([1,1,2,2,3,3,4,4,5])==True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5\n",
"1 2 3 4 4\n",
"1 1 2 2 3 3 4 4 5\n"
],
"test_output": [
"False\n",
"True\n",
"True\n"
],
"example_input": [
"1 2 3 4 5\n",
"1 2 3 4 4\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a function to find whether a given array of integers contains any duplicate element.\nWe have its functional test sample:\nassert test_duplicate(([1,2,3,4,5]))==False\nassert test_duplicate(([1,2,3,4, 4]))==True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n1 2 3 4 4\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 7,
"prompt": "Write a function to check if the given number is woodball or not.",
"code": "def is_woodall(x): \n\tif (x % 2 == 0): \n\t\treturn False\n\tif (x == 1): \n\t\treturn True\n\tx = x + 1 \n\tp = 0\n\twhile (x % 2 == 0): \n\t\tx = x/2\n\t\tp = p + 1\n\t\tif (p == x): \n\t\t\treturn True\n\treturn False",
"test_imports": [],
"test_list": [
"assert is_woodall(383) == True",
"assert is_woodall(254) == False",
"assert is_woodall(200) == False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"383\n",
"254\n",
"200\n"
],
"test_output": [
"True\n",
"False\n",
"False\n"
],
"example_input": [
"383\n",
"254\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to check if the given number is woodball or not.\nWe have its functional test sample:\nassert is_woodall(383) == True\nassert is_woodall(254) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n383\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n254\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 8,
"prompt": "Write a python function to check if a given number is one less than twice its reverse.",
"code": "def rev(num): \n rev_num = 0\n while (num > 0): \n rev_num = (rev_num * 10 + num % 10) \n num = num // 10 \n return rev_num \ndef check(n): \n return (2 * rev(n) == n + 1) ",
"test_imports": [],
"test_list": [
"assert check(70) == False",
"assert check(23) == False",
"assert check(73) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"70\n",
"23\n",
"73\n"
],
"test_output": [
"False\n",
"False\n",
"True\n"
],
"example_input": [
"70\n",
"23\n"
],
"example_output": [
"False\n",
"False\n"
],
"question": "Original problem description:\nWrite a python function to check if a given number is one less than twice its reverse.\nWe have its functional test sample:\nassert check(70) == False\nassert check(23) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n70\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n23\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 9,
"prompt": "Write a python function to find the largest number that can be formed with the given list of digits.",
"code": "def find_Max_Num(arr) : \n n = len(arr)\n arr.sort(reverse = True) \n num = arr[0] \n for i in range(1,n) : \n num = num * 10 + arr[i] \n return num ",
"test_imports": [],
"test_list": [
"assert find_Max_Num([1,2,3]) == 321",
"assert find_Max_Num([4,5,6,1]) == 6541",
"assert find_Max_Num([1,2,3,9]) == 9321"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3\n",
"4 5 6 1\n",
"1 2 3 9\n"
],
"test_output": [
"321\n",
"6541\n",
"9321\n"
],
"example_input": [
"1 2 3\n",
"4 5 6 1\n"
],
"example_output": [
"321\n",
"6541\n"
],
"question": "Original problem description:\nWrite a python function to find the largest number that can be formed with the given list of digits.\nWe have its functional test sample:\nassert find_Max_Num([1,2,3]) == 321\nassert find_Max_Num([4,5,6,1]) == 6541\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3\n\nOutput:\n321\n\n\nExample 2:\nInput:\n4 5 6 1\n\nOutput:\n6541\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 10,
"prompt": "Write a python function to check whether the given two integers have opposite sign or not.",
"code": "def opposite_Signs(x,y): \n return ((x ^ y) < 0); ",
"test_imports": [],
"test_list": [
"assert opposite_Signs(1,-2) == True",
"assert opposite_Signs(3,2) == False",
"assert opposite_Signs(-10,-10) == False",
"assert opposite_Signs(-2,2) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n-2\n",
"3\n2\n",
"-10\n-10\n",
"-2\n2\n"
],
"test_output": [
"True\n",
"False\n",
"False\n",
"True\n"
],
"example_input": [
"1\n-2\n",
"3\n2\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a python function to check whether the given two integers have opposite sign or not.\nWe have its functional test sample:\nassert opposite_Signs(1,-2) == True\nassert opposite_Signs(3,2) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n-2\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n3\n2\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 11,
"prompt": "Write a function to find the nth octagonal number.",
"code": "def is_octagonal(n): \n\treturn 3 * n * n - 2 * n ",
"test_imports": [],
"test_list": [
"assert is_octagonal(5) == 65",
"assert is_octagonal(10) == 280",
"assert is_octagonal(15) == 645"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n",
"10\n",
"15\n"
],
"test_output": [
"65\n",
"280\n",
"645\n"
],
"example_input": [
"5\n",
"10\n"
],
"example_output": [
"65\n",
"280\n"
],
"question": "Original problem description:\nWrite a function to find the nth octagonal number.\nWe have its functional test sample:\nassert is_octagonal(5) == 65\nassert is_octagonal(10) == 280\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n\nOutput:\n65\n\n\nExample 2:\nInput:\n10\n\nOutput:\n280\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 12,
"prompt": "Write a python function to count the number of substrings with the sum of digits equal to their length.",
"code": "from collections import defaultdict\ndef count_Substrings(s):\n n = len(s)\n count,sum = 0,0\n mp = defaultdict(lambda : 0)\n mp[0] += 1\n for i in range(n):\n sum += ord(s[i]) - ord('0')\n count += mp[sum - (i + 1)]\n mp[sum - (i + 1)] += 1\n return count",
"test_imports": [],
"test_list": [
"assert count_Substrings('112112') == 6",
"assert count_Substrings('111') == 6",
"assert count_Substrings('1101112') == 12"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"112112\n",
"111\n",
"1101112\n"
],
"test_output": [
"6\n",
"6\n",
"12\n"
],
"example_input": [
"112112\n",
"111\n"
],
"example_output": [
"6\n",
"6\n"
],
"question": "Original problem description:\nWrite a python function to count the number of substrings with the sum of digits equal to their length.\nWe have its functional test sample:\nassert count_Substrings('112112') == 6\nassert count_Substrings('111') == 6\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n112112\n\nOutput:\n6\n\n\nExample 2:\nInput:\n111\n\nOutput:\n6\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 13,
"prompt": "Write a python function to find smallest number in a list.",
"code": "def smallest_num(xs):\n return min(xs)\n",
"test_imports": [],
"test_list": [
"assert smallest_num([10, 20, 1, 45, 99]) == 1",
"assert smallest_num([1, 2, 3]) == 1",
"assert smallest_num([45, 46, 50, 60]) == 45"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 20 1 45 99\n",
"1 2 3\n",
"45 46 50 60\n"
],
"test_output": [
"1\n",
"1\n",
"45\n"
],
"example_input": [
"10 20 1 45 99\n",
"1 2 3\n"
],
"example_output": [
"1\n",
"1\n"
],
"question": "Original problem description:\nWrite a python function to find smallest number in a list.\nWe have its functional test sample:\nassert smallest_num([10, 20, 1, 45, 99]) == 1\nassert smallest_num([1, 2, 3]) == 1\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 20 1 45 99\n\nOutput:\n1\n\n\nExample 2:\nInput:\n1 2 3\n\nOutput:\n1\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 14,
"prompt": "Write a function to find the maximum difference between available pairs in the given tuple list.",
"code": "def max_difference(test_list):\n temp = [abs(b - a) for a, b in test_list]\n res = max(temp)\n return (res) ",
"test_imports": [],
"test_list": [
"assert max_difference([(3, 5), (1, 7), (10, 3), (1, 2)]) == 7",
"assert max_difference([(4, 6), (2, 17), (9, 13), (11, 12)]) == 15",
"assert max_difference([(12, 35), (21, 27), (13, 23), (41, 22)]) == 23"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3 5\n1 7\n10 3\n1 2\n",
"4 6\n2 17\n9 13\n11 12\n",
"12 35\n21 27\n13 23\n41 22\n"
],
"test_output": [
"7\n",
"15\n",
"23\n"
],
"example_input": [
"3 5\n1 7\n10 3\n1 2\n",
"4 6\n2 17\n9 13\n11 12\n"
],
"example_output": [
"7\n",
"15\n"
],
"question": "Original problem description:\nWrite a function to find the maximum difference between available pairs in the given tuple list.\nWe have its functional test sample:\nassert max_difference([(3, 5), (1, 7), (10, 3), (1, 2)]) == 7\nassert max_difference([(4, 6), (2, 17), (9, 13), (11, 12)]) == 15\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3 5\n1 7\n10 3\n1 2\n\nOutput:\n7\n\n\nExample 2:\nInput:\n4 6\n2 17\n9 13\n11 12\n\nOutput:\n15\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 17,
"prompt": "Write a python function to count the number of positive numbers in a list.",
"code": "def pos_count(list):\n pos_count= 0\n for num in list: \n if num >= 0: \n pos_count += 1\n return pos_count ",
"test_imports": [],
"test_list": [
"assert pos_count([1,-2,3,-4]) == 2",
"assert pos_count([3,4,5,-1]) == 3",
"assert pos_count([1,2,3,4]) == 4"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 -2 3 -4\n",
"3 4 5 -1\n",
"1 2 3 4\n"
],
"test_output": [
"2\n",
"3\n",
"4\n"
],
"example_input": [
"1 -2 3 -4\n",
"3 4 5 -1\n"
],
"example_output": [
"2\n",
"3\n"
],
"question": "Original problem description:\nWrite a python function to count the number of positive numbers in a list.\nWe have its functional test sample:\nassert pos_count([1,-2,3,-4]) == 2\nassert pos_count([3,4,5,-1]) == 3\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 -2 3 -4\n\nOutput:\n2\n\n\nExample 2:\nInput:\n3 4 5 -1\n\nOutput:\n3\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 18,
"prompt": "Write a function to find the number of ways to partition a set of Bell numbers.",
"code": "def bell_number(n): \n bell = [[0 for i in range(n+1)] for j in range(n+1)] \n bell[0][0] = 1\n for i in range(1, n+1): \n bell[i][0] = bell[i-1][i-1] \n for j in range(1, i+1): \n bell[i][j] = bell[i-1][j-1] + bell[i][j-1] \n return bell[n][0] ",
"test_imports": [],
"test_list": [
"assert bell_number(2)==2",
"assert bell_number(10)==115975",
"assert bell_number(56)==6775685320645824322581483068371419745979053216268760300"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n",
"10\n",
"56\n"
],
"test_output": [
"2\n",
"115975\n",
"6775685320645824322581483068371419745979053216268760300\n"
],
"example_input": [
"2\n",
"10\n"
],
"example_output": [
"2\n",
"115975\n"
],
"question": "Original problem description:\nWrite a function to find the number of ways to partition a set of Bell numbers.\nWe have its functional test sample:\nassert bell_number(2)==2\nassert bell_number(10)==115975\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n\nOutput:\n2\n\n\nExample 2:\nInput:\n10\n\nOutput:\n115975\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 19,
"prompt": "Write a python function to check whether the given array is monotonic or not.",
"code": "def is_Monotonic(A): \n return (all(A[i] <= A[i + 1] for i in range(len(A) - 1)) or\n all(A[i] >= A[i + 1] for i in range(len(A) - 1))) ",
"test_imports": [],
"test_list": [
"assert is_Monotonic([6, 5, 4, 4]) == True",
"assert is_Monotonic([1, 2, 2, 3]) == True",
"assert is_Monotonic([1, 3, 2]) == False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"6 5 4 4\n",
"1 2 2 3\n",
"1 3 2\n"
],
"test_output": [
"True\n",
"True\n",
"False\n"
],
"example_input": [
"6 5 4 4\n",
"1 2 2 3\n"
],
"example_output": [
"True\n",
"True\n"
],
"question": "Original problem description:\nWrite a python function to check whether the given array is monotonic or not.\nWe have its functional test sample:\nassert is_Monotonic([6, 5, 4, 4]) == True\nassert is_Monotonic([1, 2, 2, 3]) == True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n6 5 4 4\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n1 2 2 3\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 20,
"prompt": "Write a function to check whether a list contains the given sublist or not.",
"code": "def is_sublist(l, s):\n\tsub_set = False\n\tif s == []:\n\t\tsub_set = True\n\telif s == l:\n\t\tsub_set = True\n\telif len(s) > len(l):\n\t\tsub_set = False\n\telse:\n\t\tfor i in range(len(l)):\n\t\t\tif l[i] == s[0]:\n\t\t\t\tn = 1\n\t\t\t\twhile (n < len(s)) and (l[i+n] == s[n]):\n\t\t\t\t\tn += 1\t\t\t\t\n\t\t\t\tif n == len(s):\n\t\t\t\t\tsub_set = True\n\treturn sub_set",
"test_imports": [],
"test_list": [
"assert is_sublist([2,4,3,5,7],[3,7])==False",
"assert is_sublist([2,4,3,5,7],[4,3])==True",
"assert is_sublist([2,4,3,5,7],[1,6])==False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2 4 3 5 7\n3 7\n",
"2 4 3 5 7\n4 3\n",
"2 4 3 5 7\n1 6\n"
],
"test_output": [
"False\n",
"True\n",
"False\n"
],
"example_input": [
"2 4 3 5 7\n3 7\n",
"2 4 3 5 7\n4 3\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a function to check whether a list contains the given sublist or not.\nWe have its functional test sample:\nassert is_sublist([2,4,3,5,7],[3,7])==False\nassert is_sublist([2,4,3,5,7],[4,3])==True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2 4 3 5 7\n3 7\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n2 4 3 5 7\n4 3\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 21,
"prompt": "Write a function to find whether all the given tuples have equal length or not.",
"code": "def find_equal_tuple(Input):\n k = 0 if not Input else len(Input[0])\n flag = 1\n for tuple in Input:\n if len(tuple) != k:\n flag = 0\n break\n return flag\ndef get_equal(Input):\n return find_equal_tuple(Input) == 1",
"test_imports": [],
"test_list": [
"assert get_equal([(11, 22, 33), (44, 55, 66)]) == True",
"assert get_equal([(1, 2, 3), (4, 5, 6, 7)]) == False",
"assert get_equal([(1, 2), (3, 4)]) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"11 22 33\n44 55 66\n",
"1 2 3\n4 5 6 7\n",
"1 2\n3 4\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"11 22 33\n44 55 66\n",
"1 2 3\n4 5 6 7\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to find whether all the given tuples have equal length or not.\nWe have its functional test sample:\nassert get_equal([(11, 22, 33), (44, 55, 66)]) == True\nassert get_equal([(1, 2, 3), (4, 5, 6, 7)]) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n11 22 33\n44 55 66\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n1 2 3\n4 5 6 7\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 22,
"prompt": "Write a function to sort a list of elements.",
"code": "def comb_sort(nums):\n shrink_fact = 1.3\n gaps = len(nums)\n swapped = True\n i = 0\n while gaps > 1 or swapped:\n gaps = int(float(gaps) / shrink_fact)\n swapped = False\n i = 0\n while gaps + i < len(nums):\n if nums[i] > nums[i+gaps]:\n nums[i], nums[i+gaps] = nums[i+gaps], nums[i]\n swapped = True\n i += 1\n return nums",
"test_imports": [],
"test_list": [
"assert comb_sort([5, 15, 37, 25, 79]) == [5, 15, 25, 37, 79]",
"assert comb_sort([41, 32, 15, 19, 22]) == [15, 19, 22, 32, 41]",
"assert comb_sort([99, 15, 13, 47]) == [13, 15, 47, 99]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5 15 37 25 79\n",
"41 32 15 19 22\n",
"99 15 13 47\n"
],
"test_output": [
"5 15 25 37 79\n",
"15 19 22 32 41\n",
"13 15 47 99\n"
],
"example_input": [
"5 15 37 25 79\n",
"41 32 15 19 22\n"
],
"example_output": [
"5 15 25 37 79\n",
"15 19 22 32 41\n"
],
"question": "Original problem description:\nWrite a function to sort a list of elements.\nWe have its functional test sample:\nassert comb_sort([5, 15, 37, 25, 79]) == [5, 15, 25, 37, 79]\nassert comb_sort([41, 32, 15, 19, 22]) == [15, 19, 22, 32, 41]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5 15 37 25 79\n\nOutput:\n5 15 25 37 79\n\n\nExample 2:\nInput:\n41 32 15 19 22\n\nOutput:\n15 19 22 32 41\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 23,
"prompt": "Write a python function to check whether the given number can be represented as the difference of two squares or not.",
"code": "def dif_Square(n): \n if (n % 4 != 2): \n return True\n return False",
"test_imports": [],
"test_list": [
"assert dif_Square(5) == True",
"assert dif_Square(10) == False",
"assert dif_Square(15) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n",
"10\n",
"15\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"5\n",
"10\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a python function to check whether the given number can be represented as the difference of two squares or not.\nWe have its functional test sample:\nassert dif_Square(5) == True\nassert dif_Square(10) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n10\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 24,
"prompt": "Write a function to check whether it follows the sequence given in the patterns array.",
"code": "def is_samepatterns(colors, patterns): \n if len(colors) != len(patterns):\n return False \n sdict = {}\n pset = set()\n sset = set() \n for i in range(len(patterns)):\n pset.add(patterns[i])\n sset.add(colors[i])\n if patterns[i] not in sdict.keys():\n sdict[patterns[i]] = []\n\n keys = sdict[patterns[i]]\n keys.append(colors[i])\n sdict[patterns[i]] = keys\n\n if len(pset) != len(sset):\n return False \n\n for values in sdict.values():\n\n for i in range(len(values) - 1):\n if values[i] != values[i+1]:\n return False\n\n return True",
"test_imports": [],
"test_list": [
"assert is_samepatterns([\"red\",\"green\",\"green\"], [\"a\", \"b\", \"b\"])==True",
"assert is_samepatterns([\"red\",\"green\",\"greenn\"], [\"a\",\"b\",\"b\"])==False",
"assert is_samepatterns([\"red\",\"green\",\"greenn\"], [\"a\",\"b\"])==False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"red green green\na b b\n",
"red green greenn\na b b\n",
"red green greenn\na b\n"
],
"test_output": [
"True\n",
"False\n",
"False\n"
],
"example_input": [
"red green green\na b b\n",
"red green greenn\na b b\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to check whether it follows the sequence given in the patterns array.\nWe have its functional test sample:\nassert is_samepatterns([\"red\",\"green\",\"green\"], [\"a\", \"b\", \"b\"])==True\nassert is_samepatterns([\"red\",\"green\",\"greenn\"], [\"a\",\"b\",\"b\"])==False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nred green green\na b b\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\nred green greenn\na b b\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 26,
"prompt": "Write a python function to find whether a number is divisible by 11.",
"code": "def is_Diff(n): \n return (n % 11 == 0) ",
"test_imports": [],
"test_list": [
"assert is_Diff (12345) == False",
"assert is_Diff(1212112) == True",
"assert is_Diff(1212) == False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"12345\n",
"1212112\n",
"1212\n"
],
"test_output": [
"False\n",
"True\n",
"False\n"
],
"example_input": [
"12345\n",
"1212112\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a python function to find whether a number is divisible by 11.\nWe have its functional test sample:\nassert is_Diff (12345) == False\nassert is_Diff(1212112) == True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n12345\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n1212112\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 27,
"prompt": "Write a python function to check whether the length of the word is odd or not.",
"code": "def word_len(s): \n s = s.split(' ') \n for word in s: \n if len(word)%2!=0: \n return True \n else:\n return False",
"test_imports": [],
"test_list": [
"assert word_len(\"Hadoop\") == False",
"assert word_len(\"great\") == True",
"assert word_len(\"structure\") == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Hadoop\n",
"great\n",
"structure\n"
],
"test_output": [
"False\n",
"True\n",
"True\n"
],
"example_input": [
"Hadoop\n",
"great\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a python function to check whether the length of the word is odd or not.\nWe have its functional test sample:\nassert word_len(\"Hadoop\") == False\nassert word_len(\"great\") == True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nHadoop\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\ngreat\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 28,
"prompt": "Write a function to find the nth tetrahedral number.",
"code": "def tetrahedral_number(n): \n\treturn (n * (n + 1) * (n + 2)) / 6",
"test_imports": [],
"test_list": [
"assert tetrahedral_number(5) == 35",
"assert tetrahedral_number(6) == 56",
"assert tetrahedral_number(7) == 84"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n",
"6\n",
"7\n"
],
"test_output": [
"35\n",
"56\n",
"84\n"
],
"example_input": [
"5\n",
"6\n"
],
"example_output": [
"35\n",
"56\n"
],
"question": "Original problem description:\nWrite a function to find the nth tetrahedral number.\nWe have its functional test sample:\nassert tetrahedral_number(5) == 35\nassert tetrahedral_number(6) == 56\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n\nOutput:\n35\n\n\nExample 2:\nInput:\n6\n\nOutput:\n56\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 30,
"prompt": "Write a python function to find the character made by adding the ASCII value of all the characters of the given string modulo 26.",
"code": "def get_Char(strr): \n summ = 0\n for i in range(len(strr)): \n summ += (ord(strr[i]) - ord('a') + 1) \n if (summ % 26 == 0): \n return ord('z') \n else: \n summ = summ % 26\n return chr(ord('a') + summ - 1)",
"test_imports": [],
"test_list": [
"assert get_Char(\"abc\") == \"f\"",
"assert get_Char(\"gfg\") == \"t\"",
"assert get_Char(\"ab\") == \"c\""
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"abc\n",
"gfg\n",
"ab\n"
],
"test_output": [
"f\n",
"t\n",
"c\n"
],
"example_input": [
"abc\n",
"gfg\n"
],
"example_output": [
"f\n",
"t\n"
],
"question": "Original problem description:\nWrite a python function to find the character made by adding the ASCII value of all the characters of the given string modulo 26.\nWe have its functional test sample:\nassert get_Char(\"abc\") == \"f\"\nassert get_Char(\"gfg\") == \"t\"\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nabc\n\nOutput:\nf\n\n\nExample 2:\nInput:\ngfg\n\nOutput:\nt\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 31,
"prompt": "Write a function to find the nth number in the newman conway sequence.",
"code": "def sequence(n): \n\tif n == 1 or n == 2: \n\t\treturn 1\n\telse: \n\t\treturn sequence(sequence(n-1)) + sequence(n-sequence(n-1))",
"test_imports": [],
"test_list": [
"assert sequence(10) == 6",
"assert sequence(2) == 1",
"assert sequence(3) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n",
"2\n",
"3\n"
],
"test_output": [
"6\n",
"1\n",
"2\n"
],
"example_input": [
"10\n",
"2\n"
],
"example_output": [
"6\n",
"1\n"
],
"question": "Original problem description:\nWrite a function to find the nth number in the newman conway sequence.\nWe have its functional test sample:\nassert sequence(10) == 6\nassert sequence(2) == 1\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n\nOutput:\n6\n\n\nExample 2:\nInput:\n2\n\nOutput:\n1\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 33,
"prompt": "Write a function to find nth centered hexagonal number.",
"code": "def centered_hexagonal_number(n):\n return 3 * n * (n - 1) + 1",
"test_imports": [],
"test_list": [
"assert centered_hexagonal_number(10) == 271",
"assert centered_hexagonal_number(2) == 7",
"assert centered_hexagonal_number(9) == 217"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n",
"2\n",
"9\n"
],
"test_output": [
"271\n",
"7\n",
"217\n"
],
"example_input": [
"10\n",
"2\n"
],
"example_output": [
"271\n",
"7\n"
],
"question": "Original problem description:\nWrite a function to find nth centered hexagonal number.\nWe have its functional test sample:\nassert centered_hexagonal_number(10) == 271\nassert centered_hexagonal_number(2) == 7\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n\nOutput:\n271\n\n\nExample 2:\nInput:\n2\n\nOutput:\n7\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 36,
"prompt": "Write a function to find the closest smaller number than n.",
"code": "def closest_num(N):\n return (N - 1)",
"test_imports": [],
"test_list": [
"assert closest_num(11) == 10",
"assert closest_num(7) == 6",
"assert closest_num(12) == 11"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"11\n",
"7\n",
"12\n"
],
"test_output": [
"10\n",
"6\n",
"11\n"
],
"example_input": [
"11\n",
"7\n"
],
"example_output": [
"10\n",
"6\n"
],
"question": "Original problem description:\nWrite a function to find the closest smaller number than n.\nWe have its functional test sample:\nassert closest_num(11) == 10\nassert closest_num(7) == 6\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n11\n\nOutput:\n10\n\n\nExample 2:\nInput:\n7\n\nOutput:\n6\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 37,
"prompt": "Write a python function to find the length of the longest word.",
"code": "def len_log(list1):\n max=len(list1[0])\n for i in list1:\n if len(i)>max:\n max=len(i)\n return max",
"test_imports": [],
"test_list": [
"assert len_log([\"python\",\"PHP\",\"bigdata\"]) == 7",
"assert len_log([\"a\",\"ab\",\"abc\"]) == 3",
"assert len_log([\"small\",\"big\",\"tall\"]) == 5"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"python PHP bigdata\n",
"a ab abc\n",
"small big tall\n"
],
"test_output": [
"7\n",
"3\n",
"5\n"
],
"example_input": [
"python PHP bigdata\n",
"a ab abc\n"
],
"example_output": [
"7\n",
"3\n"
],
"question": "Original problem description:\nWrite a python function to find the length of the longest word.\nWe have its functional test sample:\nassert len_log([\"python\",\"PHP\",\"bigdata\"]) == 7\nassert len_log([\"a\",\"ab\",\"abc\"]) == 3\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npython PHP bigdata\n\nOutput:\n7\n\n\nExample 2:\nInput:\na ab abc\n\nOutput:\n3\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 38,
"prompt": "Write a function to check if a string is present as a substring in a given list of string values.",
"code": "def find_substring(str1, sub_str):\n if any(sub_str in s for s in str1):\n return True\n return False",
"test_imports": [],
"test_list": [
"assert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"ack\")==True",
"assert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"abc\")==False",
"assert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"ange\")==True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"red black white green orange\nack\n",
"red black white green orange\nabc\n",
"red black white green orange\nange\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"red black white green orange\nack\n",
"red black white green orange\nabc\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to check if a string is present as a substring in a given list of string values.\nWe have its functional test sample:\nassert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"ack\")==True\nassert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"abc\")==False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nred black white green orange\nack\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\nred black white green orange\nabc\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 39,
"prompt": "Write a function to check whether the given number is undulating or not.",
"code": "def is_undulating(n): \n\tn = str(n)\n\tif (len(n) <= 2): \n\t\treturn False\n\tfor i in range(2, len(n)): \n\t\tif (n[i - 2] != n[i]): \n\t\t\treturn False\n\treturn True",
"test_imports": [],
"test_list": [
"assert is_undulating(1212121) == True",
"assert is_undulating(1991) == False",
"assert is_undulating(121) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1212121\n",
"1991\n",
"121\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"1212121\n",
"1991\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to check whether the given number is undulating or not.\nWe have its functional test sample:\nassert is_undulating(1212121) == True\nassert is_undulating(1991) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1212121\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n1991\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 40,
"prompt": "Write a function to calculate the value of 'a' to the power 'b'.",
"code": "def power(a,b):\n\tif b==0:\n\t\treturn 1\n\telif a==0:\n\t\treturn 0\n\telif b==1:\n\t\treturn a\n\telse:\n\t\treturn a*power(a,b-1)",
"test_imports": [],
"test_list": [
"assert power(3,4) == 81",
"assert power(2,3) == 8",
"assert power(5,5) == 3125"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3\n4\n",
"2\n3\n",
"5\n5\n"
],
"test_output": [
"81\n",
"8\n",
"3125\n"
],
"example_input": [
"3\n4\n",
"2\n3\n"
],
"example_output": [
"81\n",
"8\n"
],
"question": "Original problem description:\nWrite a function to calculate the value of 'a' to the power 'b'.\nWe have its functional test sample:\nassert power(3,4) == 81\nassert power(2,3) == 8\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3\n4\n\nOutput:\n81\n\n\nExample 2:\nInput:\n2\n3\n\nOutput:\n8\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 41,
"prompt": "Given a list of tuples, write a function that returns the first value of the tuple with the smallest second value.",
"code": "from operator import itemgetter \ndef index_minimum(test_list):\n res = min(test_list, key = itemgetter(1))[0]\n return (res) ",
"test_imports": [],
"test_list": [
"assert index_minimum([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)]) == 'Varsha'",
"assert index_minimum([('Yash', 185), ('Dawood', 125), ('Sanya', 175)]) == 'Dawood'",
"assert index_minimum([('Sai', 345), ('Salman', 145), ('Ayesha', 96)]) == 'Ayesha'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Rash 143\nManjeet 200\nVarsha 100\n",
"Yash 185\nDawood 125\nSanya 175\n",
"Sai 345\nSalman 145\nAyesha 96\n"
],
"test_output": [
"Varsha\n",
"Dawood\n",
"Ayesha\n"
],
"example_input": [
"Rash 143\nManjeet 200\nVarsha 100\n",
"Yash 185\nDawood 125\nSanya 175\n"
],
"example_output": [
"Varsha\n",
"Dawood\n"
],
"question": "Original problem description:\nGiven a list of tuples, write a function that returns the first value of the tuple with the smallest second value.\nWe have its functional test sample:\nassert index_minimum([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)]) == 'Varsha'\nassert index_minimum([('Yash', 185), ('Dawood', 125), ('Sanya', 175)]) == 'Dawood'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nRash 143\nManjeet 200\nVarsha 100\n\nOutput:\nVarsha\n\n\nExample 2:\nInput:\nYash 185\nDawood 125\nSanya 175\n\nOutput:\nDawood\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 42,
"prompt": "Write a python function to find the length of the smallest list in a list of lists.",
"code": "def Find_Min_Length(lst): \n minLength = min(len(x) for x in lst )\n return minLength ",
"test_imports": [],
"test_list": [
"assert Find_Min_Length([[1],[1,2]]) == 1",
"assert Find_Min_Length([[1,2],[1,2,3],[1,2,3,4]]) == 2",
"assert Find_Min_Length([[3,3,3],[4,4,4,4]]) == 3"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n1 2\n",
"1 2\n1 2 3\n1 2 3 4\n",
"3 3 3\n4 4 4 4\n"
],
"test_output": [
"1\n",
"2\n",
"3\n"
],
"example_input": [
"1\n1 2\n",
"1 2\n1 2 3\n1 2 3 4\n"
],
"example_output": [
"1\n",
"2\n"
],
"question": "Original problem description:\nWrite a python function to find the length of the smallest list in a list of lists.\nWe have its functional test sample:\nassert Find_Min_Length([[1],[1,2]]) == 1\nassert Find_Min_Length([[1,2],[1,2,3],[1,2,3,4]]) == 2\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n1 2\n\nOutput:\n1\n\n\nExample 2:\nInput:\n1 2\n1 2 3\n1 2 3 4\n\nOutput:\n2\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 43,
"prompt": "Write a python function to find the number of divisors of a given integer.",
"code": "def divisor(n):\n for i in range(n):\n x = len([i for i in range(1,n+1) if not n % i])\n return x",
"test_imports": [],
"test_list": [
"assert divisor(15) == 4",
"assert divisor(12) == 6",
"assert divisor(9) == 3"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"15\n",
"12\n",
"9\n"
],
"test_output": [
"4\n",
"6\n",
"3\n"
],
"example_input": [
"15\n",
"12\n"
],
"example_output": [
"4\n",
"6\n"
],
"question": "Original problem description:\nWrite a python function to find the number of divisors of a given integer.\nWe have its functional test sample:\nassert divisor(15) == 4\nassert divisor(12) == 6\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n15\n\nOutput:\n4\n\n\nExample 2:\nInput:\n12\n\nOutput:\n6\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 46,
"prompt": "Write a function to convert the given decimal number to its binary equivalent, represented as a string with no leading zeros.",
"code": "def decimal_to_binary(n): \n return bin(n).replace(\"0b\",\"\") ",
"test_imports": [],
"test_list": [
"assert decimal_to_binary(8) == '1000'",
"assert decimal_to_binary(18) == '10010'",
"assert decimal_to_binary(7) == '111'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"8\n",
"18\n",
"7\n"
],
"test_output": [
"1000\n",
"10010\n",
"111\n"
],
"example_input": [
"8\n",
"18\n"
],
"example_output": [
"1000\n",
"10010\n"
],
"question": "Original problem description:\nWrite a function to convert the given decimal number to its binary equivalent, represented as a string with no leading zeros.\nWe have its functional test sample:\nassert decimal_to_binary(8) == '1000'\nassert decimal_to_binary(18) == '10010'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n8\n\nOutput:\n1000\n\n\nExample 2:\nInput:\n18\n\nOutput:\n10010\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 47,
"prompt": "Write a function to find the next smallest palindrome of a specified integer, returned as an integer.",
"code": "import sys\ndef next_smallest_palindrome(num):\n numstr = str(num)\n for i in range(num+1,sys.maxsize):\n if str(i) == str(i)[::-1]:\n return i",
"test_imports": [],
"test_list": [
"assert next_smallest_palindrome(99)==101",
"assert next_smallest_palindrome(1221)==1331",
"assert next_smallest_palindrome(120)==121"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"99\n",
"1221\n",
"120\n"
],
"test_output": [
"101\n",
"1331\n",
"121\n"
],
"example_input": [
"99\n",
"1221\n"
],
"example_output": [
"101\n",
"1331\n"
],
"question": "Original problem description:\nWrite a function to find the next smallest palindrome of a specified integer, returned as an integer.\nWe have its functional test sample:\nassert next_smallest_palindrome(99)==101\nassert next_smallest_palindrome(1221)==1331\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n99\n\nOutput:\n101\n\n\nExample 2:\nInput:\n1221\n\nOutput:\n1331\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 48,
"prompt": "Write a function to find the kth element in the given array using 1-based indexing.",
"code": "def kth_element(arr, k):\n n = len(arr)\n for i in range(n):\n for j in range(0, n-i-1):\n if arr[j] > arr[j+1]:\n arr[j], arr[j+1] == arr[j+1], arr[j]\n return arr[k-1]",
"test_imports": [],
"test_list": [
"assert kth_element([12,3,5,7,19], 2) == 3",
"assert kth_element([17,24,8,23], 3) == 8",
"assert kth_element([16,21,25,36,4], 4) == 36"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"12 3 5 7 19\n2\n",
"17 24 8 23\n3\n",
"16 21 25 36 4\n4\n"
],
"test_output": [
"3\n",
"8\n",
"36\n"
],
"example_input": [
"12 3 5 7 19\n2\n",
"17 24 8 23\n3\n"
],
"example_output": [
"3\n",
"8\n"
],
"question": "Original problem description:\nWrite a function to find the kth element in the given array using 1-based indexing.\nWe have its functional test sample:\nassert kth_element([12,3,5,7,19], 2) == 3\nassert kth_element([17,24,8,23], 3) == 8\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n12 3 5 7 19\n2\n\nOutput:\n3\n\n\nExample 2:\nInput:\n17 24 8 23\n3\n\nOutput:\n8\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 49,
"prompt": "Write a function to convert a snake case string to camel case string.",
"code": "def snake_to_camel(word):\n import re\n return ''.join(x.capitalize() or '_' for x in word.split('_'))",
"test_imports": [],
"test_list": [
"assert snake_to_camel('python_program')=='PythonProgram'",
"assert snake_to_camel('python_language')==('PythonLanguage')",
"assert snake_to_camel('programming_language')==('ProgrammingLanguage')"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"python_program\n",
"python_language\n",
"programming_language\n"
],
"test_output": [
"PythonProgram\n",
"PythonLanguage\n",
"ProgrammingLanguage\n"
],
"example_input": [
"python_program\n",
"python_language\n"
],
"example_output": [
"PythonProgram\n",
"PythonLanguage\n"
],
"question": "Original problem description:\nWrite a function to convert a snake case string to camel case string.\nWe have its functional test sample:\nassert snake_to_camel('python_program')=='PythonProgram'\nassert snake_to_camel('python_language')==('PythonLanguage')\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npython_program\n\nOutput:\nPythonProgram\n\n\nExample 2:\nInput:\npython_language\n\nOutput:\nPythonLanguage\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 50,
"prompt": "Write a function to find the Eulerian number a(n, m).",
"code": "def eulerian_num(n, m): \n\tif (m >= n or n == 0): \n\t\treturn 0 \n\tif (m == 0): \n\t\treturn 1 \n\treturn ((n - m) * eulerian_num(n - 1, m - 1) +(m + 1) * eulerian_num(n - 1, m))",
"test_imports": [],
"test_list": [
"assert eulerian_num(3, 1) == 4",
"assert eulerian_num(4, 1) == 11",
"assert eulerian_num(5, 3) == 26"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3\n1\n",
"4\n1\n",
"5\n3\n"
],
"test_output": [
"4\n",
"11\n",
"26\n"
],
"example_input": [
"3\n1\n",
"4\n1\n"
],
"example_output": [
"4\n",
"11\n"
],
"question": "Original problem description:\nWrite a function to find the Eulerian number a(n, m).\nWe have its functional test sample:\nassert eulerian_num(3, 1) == 4\nassert eulerian_num(4, 1) == 11\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3\n1\n\nOutput:\n4\n\n\nExample 2:\nInput:\n4\n1\n\nOutput:\n11\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 51,
"prompt": "Write a function to sort each sublist of strings in a given list of lists.",
"code": "def sort_sublists(input_list):\n result = [sorted(x, key = lambda x:x[0]) for x in input_list] \n return result\n",
"test_imports": [],
"test_list": [
"assert sort_sublists(([\"green\", \"orange\"], [\"black\", \"white\"], [\"white\", \"black\", \"orange\"]))==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]",
"assert sort_sublists(([\" red \",\"green\" ],[\"blue \",\" black\"],[\" orange\",\"brown\"]))==[[' red ', 'green'], [' black', 'blue '], [' orange', 'brown']]",
"assert sort_sublists(([\"zilver\",\"gold\"], [\"magnesium\",\"aluminium\"], [\"steel\", \"bronze\"]))==[['gold', 'zilver'],['aluminium', 'magnesium'], ['bronze', 'steel']]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"green orange\nblack white\nwhite black orange\n",
"red green\nblue black\n orange brown\n",
"zilver gold\nmagnesium aluminium\nsteel bronze\n"
],
"test_output": [
"green orange\nblack white\nblack orange white\n",
"red green\n black blue \n orange brown\n",
"gold zilver\naluminium magnesium\nbronze steel\n"
],
"example_input": [
"green orange\nblack white\nwhite black orange\n",
"red green\nblue black\n orange brown\n"
],
"example_output": [
"green orange\nblack white\nblack orange white\n",
"red green\n black blue \n orange brown\n"
],
"question": "Original problem description:\nWrite a function to sort each sublist of strings in a given list of lists.\nWe have its functional test sample:\nassert sort_sublists(([\"green\", \"orange\"], [\"black\", \"white\"], [\"white\", \"black\", \"orange\"]))==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]\nassert sort_sublists(([\" red \",\"green\" ],[\"blue \",\" black\"],[\" orange\",\"brown\"]))==[[' red ', 'green'], [' black', 'blue '], [' orange', 'brown']]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\ngreen orange\nblack white\nwhite black orange\n\nOutput:\ngreen orange\nblack white\nblack orange white\n\n\nExample 2:\nInput:\nred green\nblue black\n orange brown\n\nOutput:\nred green\n black blue \n orange brown\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 52,
"prompt": "Write a python function to count true booleans in the given list.",
"code": "def count(lst): \n return sum(lst) ",
"test_imports": [],
"test_list": [
"assert count([True,False,True]) == 2",
"assert count([False,False]) == 0",
"assert count([True,True,True]) == 3"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"True False True\n",
"False False\n",
"True True True\n"
],
"test_output": [
"2\n",
"0\n",
"3\n"
],
"example_input": [
"True False True\n",
"False False\n"
],
"example_output": [
"2\n",
"0\n"
],
"question": "Original problem description:\nWrite a python function to count true booleans in the given list.\nWe have its functional test sample:\nassert count([True,False,True]) == 2\nassert count([False,False]) == 0\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nTrue False True\n\nOutput:\n2\n\n\nExample 2:\nInput:\nFalse False\n\nOutput:\n0\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 53,
"prompt": "Write a function to append the given list to the given tuples.",
"code": "def add_lists(test_list, test_tup):\n res = tuple(list(test_tup) + test_list)\n return (res) ",
"test_imports": [],
"test_list": [
"assert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7)",
"assert add_lists([6, 7, 8], (10, 11)) == (10, 11, 6, 7, 8)",
"assert add_lists([7, 8, 9], (11, 12)) == (11, 12, 7, 8, 9)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5 6 7\n9 10\n",
"6 7 8\n10 11\n",
"7 8 9\n11 12\n"
],
"test_output": [
"9 10 5 6 7\n",
"10 11 6 7 8\n",
"11 12 7 8 9\n"
],
"example_input": [
"5 6 7\n9 10\n",
"6 7 8\n10 11\n"
],
"example_output": [
"9 10 5 6 7\n",
"10 11 6 7 8\n"
],
"question": "Original problem description:\nWrite a function to append the given list to the given tuples.\nWe have its functional test sample:\nassert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7)\nassert add_lists([6, 7, 8], (10, 11)) == (10, 11, 6, 7, 8)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5 6 7\n9 10\n\nOutput:\n9 10 5 6 7\n\n\nExample 2:\nInput:\n6 7 8\n10 11\n\nOutput:\n10 11 6 7 8\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 54,
"prompt": "Write a function to merge three lists into a single sorted list.",
"code": "import heapq\ndef merge_sorted_list(num1,num2,num3):\n num1=sorted(num1)\n num2=sorted(num2)\n num3=sorted(num3)\n result = heapq.merge(num1,num2,num3)\n return list(result)",
"test_imports": [],
"test_list": [
"assert merge_sorted_list([25, 24, 15, 4, 5, 29, 110],[19, 20, 11, 56, 25, 233, 154],[24, 26, 54, 48])==[4, 5, 11, 15, 19, 20, 24, 24, 25, 25, 26, 29, 48, 54, 56, 110, 154, 233]",
"assert merge_sorted_list([1, 3, 5, 6, 8, 9], [2, 5, 7, 11], [1, 4, 7, 8, 12])==[1, 1, 2, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 11, 12]",
"assert merge_sorted_list([18, 14, 10, 9, 8, 7, 9, 3, 2, 4, 1],[25, 35, 22, 85, 14, 65, 75, 25, 58],[12, 74, 9, 50, 61, 41])==[1, 2, 3, 4, 7, 8, 9, 9, 9, 10, 12, 14, 14, 18, 22, 25, 25, 35, 41, 50, 58, 61, 65, 74, 75, 85]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"25 24 15 4 5 29 110\n19 20 11 56 25 233 154\n24 26 54 48\n",
"1 3 5 6 8 9\n2 5 7 11\n1 4 7 8 12\n",
"18 14 10 9 8 7 9 3 2 4 1\n25 35 22 85 14 65 75 25 58\n12 74 9 50 61 41\n"
],
"test_output": [
"4 5 11 15 19 20 24 24 25 25 26 29 48 54 56 110 154 233\n",
"1 1 2 3 4 5 5 6 7 7 8 8 9 11 12\n",
"1 2 3 4 7 8 9 9 9 10 12 14 14 18 22 25 25 35 41 50 58 61 65 74 75 85\n"
],
"example_input": [
"25 24 15 4 5 29 110\n19 20 11 56 25 233 154\n24 26 54 48\n",
"1 3 5 6 8 9\n2 5 7 11\n1 4 7 8 12\n"
],
"example_output": [
"4 5 11 15 19 20 24 24 25 25 26 29 48 54 56 110 154 233\n",
"1 1 2 3 4 5 5 6 7 7 8 8 9 11 12\n"
],
"question": "Original problem description:\nWrite a function to merge three lists into a single sorted list.\nWe have its functional test sample:\nassert merge_sorted_list([25, 24, 15, 4, 5, 29, 110],[19, 20, 11, 56, 25, 233, 154],[24, 26, 54, 48])==[4, 5, 11, 15, 19, 20, 24, 24, 25, 25, 26, 29, 48, 54, 56, 110, 154, 233]\nassert merge_sorted_list([1, 3, 5, 6, 8, 9], [2, 5, 7, 11], [1, 4, 7, 8, 12])==[1, 1, 2, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 11, 12]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n25 24 15 4 5 29 110\n19 20 11 56 25 233 154\n24 26 54 48\n\nOutput:\n4 5 11 15 19 20 24 24 25 25 26 29 48 54 56 110 154 233\n\n\nExample 2:\nInput:\n1 3 5 6 8 9\n2 5 7 11\n1 4 7 8 12\n\nOutput:\n1 1 2 3 4 5 5 6 7 7 8 8 9 11 12\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 55,
"prompt": "Write a python function to find the number of numbers with an odd value when rotating a binary string the given number of times.",
"code": "def odd_Equivalent(s,n): \n count=0\n for i in range(0,n): \n if (s[i] == '1'): \n count = count + 1\n return count ",
"test_imports": [],
"test_list": [
"assert odd_Equivalent(\"011001\",6) == 3",
"assert odd_Equivalent(\"11011\",5) == 4",
"assert odd_Equivalent(\"1010\",4) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"011001\n6\n",
"11011\n5\n",
"1010\n4\n"
],
"test_output": [
"3\n",
"4\n",
"2\n"
],
"example_input": [
"011001\n6\n",
"11011\n5\n"
],
"example_output": [
"3\n",
"4\n"
],
"question": "Original problem description:\nWrite a python function to find the number of numbers with an odd value when rotating a binary string the given number of times.\nWe have its functional test sample:\nassert odd_Equivalent(\"011001\",6) == 3\nassert odd_Equivalent(\"11011\",5) == 4\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n011001\n6\n\nOutput:\n3\n\n\nExample 2:\nInput:\n11011\n5\n\nOutput:\n4\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 56,
"prompt": "Write a function to find the common elements in given nested lists.",
"code": "def common_in_nested_lists(nestedlist):\n result = list(set.intersection(*map(set, nestedlist)))\n return result",
"test_imports": [],
"test_list": [
"assert set(common_in_nested_lists([[12, 18, 23, 25, 45], [7, 12, 18, 24, 28], [1, 5, 8, 12, 15, 16, 18]]))==set([18, 12])",
"assert set(common_in_nested_lists([[12, 5, 23, 25, 45], [7, 11, 5, 23, 28], [1, 5, 8, 18, 23, 16]]))==set([5,23])",
"assert set(common_in_nested_lists([[2, 3,4, 1], [4, 5], [6,4, 8],[4, 5], [6, 8,4]]))==set([4])"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"12 18 23 25 45\n7 12 18 24 28\n1 5 8 12 15 16 18\n",
"12 5 23 25 45\n7 11 5 23 28\n1 5 8 18 23 16\n",
"2 3 4 1\n4 5\n6 4 8\n4 5\n6 8 4\n"
],
"test_output": [
"18 12\n",
"5 23\n",
"4\n"
],
"example_input": [
"12 18 23 25 45\n7 12 18 24 28\n1 5 8 12 15 16 18\n",
"12 5 23 25 45\n7 11 5 23 28\n1 5 8 18 23 16\n"
],
"example_output": [
"18 12\n",
"5 23\n"
],
"question": "Original problem description:\nWrite a function to find the common elements in given nested lists.\nWe have its functional test sample:\nassert set(common_in_nested_lists([[12, 18, 23, 25, 45], [7, 12, 18, 24, 28], [1, 5, 8, 12, 15, 16, 18]]))==set([18, 12])\nassert set(common_in_nested_lists([[12, 5, 23, 25, 45], [7, 11, 5, 23, 28], [1, 5, 8, 18, 23, 16]]))==set([5,23])\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n12 18 23 25 45\n7 12 18 24 28\n1 5 8 12 15 16 18\n\nOutput:\n18 12\n\n\nExample 2:\nInput:\n12 5 23 25 45\n7 11 5 23 28\n1 5 8 18 23 16\n\nOutput:\n5 23\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 57,
"prompt": "Write a function to check if a string represents an integer or not.",
"code": "def check_integer(text):\n text = text.strip()\n if len(text) < 1:\n return None\n else:\n if all(text[i] in \"0123456789\" for i in range(len(text))):\n return True\n elif (text[0] in \"+-\") and \\\n all(text[i] in \"0123456789\" for i in range(1,len(text))):\n return True\n else:\n return False",
"test_imports": [],
"test_list": [
"assert check_integer(\"python\")==False",
"assert check_integer(\"1\")==True",
"assert check_integer(\"12345\")==True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"python\n",
"1\n",
"12345\n"
],
"test_output": [
"False\n",
"True\n",
"True\n"
],
"example_input": [
"python\n",
"1\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a function to check if a string represents an integer or not.\nWe have its functional test sample:\nassert check_integer(\"python\")==False\nassert check_integer(\"1\")==True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npython\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n1\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 59,
"prompt": "Write a function to convert a given tuple of positive integers into a single integer.",
"code": "def tuple_to_int(nums):\n result = int(''.join(map(str,nums)))\n return result",
"test_imports": [],
"test_list": [
"assert tuple_to_int((1,2,3))==123",
"assert tuple_to_int((4,5,6))==456",
"assert tuple_to_int((5,6,7))==567"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n2\n3\n",
"4\n5\n6\n",
"5\n6\n7\n"
],
"test_output": [
"123\n",
"456\n",
"567\n"
],
"example_input": [
"1\n2\n3\n",
"4\n5\n6\n"
],
"example_output": [
"123\n",
"456\n"
],
"question": "Original problem description:\nWrite a function to convert a given tuple of positive integers into a single integer.\nWe have its functional test sample:\nassert tuple_to_int((1,2,3))==123\nassert tuple_to_int((4,5,6))==456\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n2\n3\n\nOutput:\n123\n\n\nExample 2:\nInput:\n4\n5\n6\n\nOutput:\n456\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 60,
"prompt": "Write a function to convert all possible convertible elements in a list of lists to floats.",
"code": "def list_to_float(test_list):\n res = []\n for tup in test_list:\n temp = []\n for ele in tup:\n if ele.isalpha():\n temp.append(ele)\n else:\n temp.append(float(ele))\n res.append((temp[0],temp[1])) \n return res",
"test_imports": [],
"test_list": [
"assert list_to_float( [(\"3\", \"4\"), (\"1\", \"26.45\"), (\"7.32\", \"8\"), (\"4\", \"8\")] ) == [(3.0, 4.0), (1.0, 26.45), (7.32, 8.0), (4.0, 8.0)]",
"assert list_to_float( [(\"4\", \"4\"), (\"2\", \"27\"), (\"4.12\", \"9\"), (\"7\", \"11\")] ) == [(4.0, 4.0), (2.0, 27.0), (4.12, 9.0), (7.0, 11.0)]",
"assert list_to_float( [(\"6\", \"78\"), (\"5\", \"26.45\"), (\"1.33\", \"4\"), (\"82\", \"13\")] ) == [(6.0, 78.0), (5.0, 26.45), (1.33, 4.0), (82.0, 13.0)]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3 4\n1 26.45\n7.32 8\n4 8\n",
"4 4\n2 27\n4.12 9\n7 11\n",
"6 78\n5 26.45\n1.33 4\n82 13\n"
],
"test_output": [
"3.0 4.0\n1.0 26.45\n7.32 8.0\n4.0 8.0\n",
"4.0 4.0\n2.0 27.0\n4.12 9.0\n7.0 11.0\n",
"6.0 78.0\n5.0 26.45\n1.33 4.0\n82.0 13.0\n"
],
"example_input": [
"3 4\n1 26.45\n7.32 8\n4 8\n",
"4 4\n2 27\n4.12 9\n7 11\n"
],
"example_output": [
"3.0 4.0\n1.0 26.45\n7.32 8.0\n4.0 8.0\n",
"4.0 4.0\n2.0 27.0\n4.12 9.0\n7.0 11.0\n"
],
"question": "Original problem description:\nWrite a function to convert all possible convertible elements in a list of lists to floats.\nWe have its functional test sample:\nassert list_to_float( [(\"3\", \"4\"), (\"1\", \"26.45\"), (\"7.32\", \"8\"), (\"4\", \"8\")] ) == [(3.0, 4.0), (1.0, 26.45), (7.32, 8.0), (4.0, 8.0)]\nassert list_to_float( [(\"4\", \"4\"), (\"2\", \"27\"), (\"4.12\", \"9\"), (\"7\", \"11\")] ) == [(4.0, 4.0), (2.0, 27.0), (4.12, 9.0), (7.0, 11.0)]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3 4\n1 26.45\n7.32 8\n4 8\n\nOutput:\n3.0 4.0\n1.0 26.45\n7.32 8.0\n4.0 8.0\n\n\nExample 2:\nInput:\n4 4\n2 27\n4.12 9\n7 11\n\nOutput:\n4.0 4.0\n2.0 27.0\n4.12 9.0\n7.0 11.0\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 61,
"prompt": "Write a function to convert a string to a list of strings split on the space character.",
"code": "def string_to_list(string): \n lst = list(string.split(\" \")) \n return lst",
"test_imports": [],
"test_list": [
"assert string_to_list(\"python programming\")==['python','programming']",
"assert string_to_list(\"lists tuples strings\")==['lists','tuples','strings']",
"assert string_to_list(\"write a program\")==['write','a','program']"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"python programming\n",
"lists tuples strings\n",
"write a program\n"
],
"test_output": [
"python programming\n",
"lists tuples strings\n",
"write a program\n"
],
"example_input": [
"python programming\n",
"lists tuples strings\n"
],
"example_output": [
"python programming\n",
"lists tuples strings\n"
],
"question": "Original problem description:\nWrite a function to convert a string to a list of strings split on the space character.\nWe have its functional test sample:\nassert string_to_list(\"python programming\")==['python','programming']\nassert string_to_list(\"lists tuples strings\")==['lists','tuples','strings']\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npython programming\n\nOutput:\npython programming\n\n\nExample 2:\nInput:\nlists tuples strings\n\nOutput:\nlists tuples strings\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 62,
"prompt": "Write a python function to find the element that appears only once in a sorted array.",
"code": "def search(arr):\n n = len(arr)\n XOR = 0\n for i in range(n) :\n XOR = XOR ^ arr[i]\n return (XOR)",
"test_imports": [],
"test_list": [
"assert search([1,1,2,2,3]) == 3",
"assert search([1,1,3,3,4,4,5,5,7,7,8]) == 8",
"assert search([1,2,2,3,3,4,4]) == 1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 1 2 2 3\n",
"1 1 3 3 4 4 5 5 7 7 8\n",
"1 2 2 3 3 4 4\n"
],
"test_output": [
"3\n",
"8\n",
"1\n"
],
"example_input": [
"1 1 2 2 3\n",
"1 1 3 3 4 4 5 5 7 7 8\n"
],
"example_output": [
"3\n",
"8\n"
],
"question": "Original problem description:\nWrite a python function to find the element that appears only once in a sorted array.\nWe have its functional test sample:\nassert search([1,1,2,2,3]) == 3\nassert search([1,1,3,3,4,4,5,5,7,7,8]) == 8\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 1 2 2 3\n\nOutput:\n3\n\n\nExample 2:\nInput:\n1 1 3 3 4 4 5 5 7 7 8\n\nOutput:\n8\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 63,
"prompt": "Write a function to find the maximum absolute product between numbers in pairs of tuples within a given list.",
"code": "def max_product_tuple(list1):\n result_max = max([abs(x * y) for x, y in list1] )\n return result_max",
"test_imports": [],
"test_list": [
"assert max_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==36",
"assert max_product_tuple([(10,20), (15,2), (5,10)] )==200",
"assert max_product_tuple([(11,44), (10,15), (20,5), (12, 9)] )==484"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2 7\n2 6\n1 8\n4 9\n",
"10 20\n15 2\n5 10\n",
"11 44\n10 15\n20 5\n12 9\n"
],
"test_output": [
"36\n",
"200\n",
"484\n"
],
"example_input": [
"2 7\n2 6\n1 8\n4 9\n",
"10 20\n15 2\n5 10\n"
],
"example_output": [
"36\n",
"200\n"
],
"question": "Original problem description:\nWrite a function to find the maximum absolute product between numbers in pairs of tuples within a given list.\nWe have its functional test sample:\nassert max_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==36\nassert max_product_tuple([(10,20), (15,2), (5,10)] )==200\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2 7\n2 6\n1 8\n4 9\n\nOutput:\n36\n\n\nExample 2:\nInput:\n10 20\n15 2\n5 10\n\nOutput:\n200\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 64,
"prompt": "Write a function to sum all amicable numbers from 1 to a specified number.",
"code": "def amicable_numbers_sum(limit):\n if not isinstance(limit, int):\n return \"Input is not an integer!\"\n if limit < 1:\n return \"Input must be bigger than 0!\"\n amicables = set()\n for num in range(2, limit+1):\n if num in amicables:\n continue\n sum_fact = sum([fact for fact in range(1, num) if num % fact == 0])\n sum_fact2 = sum([fact for fact in range(1, sum_fact) if sum_fact % fact == 0])\n if num == sum_fact2 and num != sum_fact:\n amicables.add(num)\n amicables.add(sum_fact2)\n return sum(amicables)",
"test_imports": [],
"test_list": [
"assert amicable_numbers_sum(999)==504",
"assert amicable_numbers_sum(9999)==31626",
"assert amicable_numbers_sum(99)==0"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"999\n",
"9999\n",
"99\n"
],
"test_output": [
"504\n",
"31626\n",
"0\n"
],
"example_input": [
"999\n",
"9999\n"
],
"example_output": [
"504\n",
"31626\n"
],
"question": "Original problem description:\nWrite a function to sum all amicable numbers from 1 to a specified number.\nWe have its functional test sample:\nassert amicable_numbers_sum(999)==504\nassert amicable_numbers_sum(9999)==31626\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n999\n\nOutput:\n504\n\n\nExample 2:\nInput:\n9999\n\nOutput:\n31626\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 66,
"prompt": "Write a function to find the maximum difference between the number of 0s and number of 1s in any sub-string of the given binary string.",
"code": "def find_length(string): \n\tn = len(string)\n\tcurrent_sum = 0\n\tmax_sum = 0\n\tfor i in range(n): \n\t\tcurrent_sum += (1 if string[i] == '0' else -1) \n\t\tif current_sum < 0: \n\t\t\tcurrent_sum = 0\n\t\tmax_sum = max(current_sum, max_sum) \n\treturn max_sum if max_sum else 0",
"test_imports": [],
"test_list": [
"assert find_length(\"11000010001\") == 6",
"assert find_length(\"10111\") == 1",
"assert find_length(\"11011101100101\") == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"11000010001\n",
"10111\n",
"11011101100101\n"
],
"test_output": [
"6\n",
"1\n",
"2\n"
],
"example_input": [
"11000010001\n",
"10111\n"
],
"example_output": [
"6\n",
"1\n"
],
"question": "Original problem description:\nWrite a function to find the maximum difference between the number of 0s and number of 1s in any sub-string of the given binary string.\nWe have its functional test sample:\nassert find_length(\"11000010001\") == 6\nassert find_length(\"10111\") == 1\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n11000010001\n\nOutput:\n6\n\n\nExample 2:\nInput:\n10111\n\nOutput:\n1\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 67,
"prompt": "Write a python function to find the sum of common divisors of two given numbers.",
"code": "def sum(a,b): \n sum = 0\n for i in range (1,min(a,b)): \n if (a % i == 0 and b % i == 0): \n sum += i \n return sum",
"test_imports": [],
"test_list": [
"assert sum(10,15) == 6",
"assert sum(100,150) == 93",
"assert sum(4,6) == 3"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n15\n",
"100\n150\n",
"4\n6\n"
],
"test_output": [
"6\n",
"93\n",
"3\n"
],
"example_input": [
"10\n15\n",
"100\n150\n"
],
"example_output": [
"6\n",
"93\n"
],
"question": "Original problem description:\nWrite a python function to find the sum of common divisors of two given numbers.\nWe have its functional test sample:\nassert sum(10,15) == 6\nassert sum(100,150) == 93\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n15\n\nOutput:\n6\n\n\nExample 2:\nInput:\n100\n150\n\nOutput:\n93\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 68,
"prompt": "Write a function to multiply two integers.",
"code": "def multiply_int(x, y):\n if y < 0:\n return -multiply_int(x, -y)\n elif y == 0:\n return 0\n elif y == 1:\n return x\n else:\n return x + multiply_int(x, y - 1)",
"test_imports": [],
"test_list": [
"assert multiply_int(10,20)==200",
"assert multiply_int(5,10)==50",
"assert multiply_int(4,8)==32"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n20\n",
"5\n10\n",
"4\n8\n"
],
"test_output": [
"200\n",
"50\n",
"32\n"
],
"example_input": [
"10\n20\n",
"5\n10\n"
],
"example_output": [
"200\n",
"50\n"
],
"question": "Original problem description:\nWrite a function to multiply two integers.\nWe have its functional test sample:\nassert multiply_int(10,20)==200\nassert multiply_int(5,10)==50\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n20\n\nOutput:\n200\n\n\nExample 2:\nInput:\n5\n10\n\nOutput:\n50\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 69,
"prompt": "Write a function to find words that are longer than n characters from a given list of words.",
"code": "def long_words(n, str):\n word_len = []\n txt = str.split(\" \")\n for x in txt:\n if len(x) > n:\n word_len.append(x)\n return word_len\t",
"test_imports": [],
"test_list": [
"assert long_words(3,\"python is a programming language\")==['python','programming','language']",
"assert long_words(2,\"writing a program\")==['writing','program']",
"assert long_words(5,\"sorting list\")==['sorting']"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3\npython is a programming language\n",
"2\nwriting a program\n",
"5\nsorting list\n"
],
"test_output": [
"python programming language\n",
"writing program\n",
"sorting\n"
],
"example_input": [
"3\npython is a programming language\n",
"2\nwriting a program\n"
],
"example_output": [
"python programming language\n",
"writing program\n"
],
"question": "Original problem description:\nWrite a function to find words that are longer than n characters from a given list of words.\nWe have its functional test sample:\nassert long_words(3,\"python is a programming language\")==['python','programming','language']\nassert long_words(2,\"writing a program\")==['writing','program']\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3\npython is a programming language\n\nOutput:\npython programming language\n\n\nExample 2:\nInput:\n2\nwriting a program\n\nOutput:\nwriting program\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 70,
"prompt": "Write a function to calculate whether the matrix is a magic square.",
"code": "def magic_square_test(my_matrix):\n iSize = len(my_matrix[0])\n sum_list = []\n sum_list.extend([sum (lines) for lines in my_matrix]) \n for col in range(iSize):\n sum_list.append(sum(row[col] for row in my_matrix))\n result1 = 0\n for i in range(0,iSize):\n result1 +=my_matrix[i][i]\n sum_list.append(result1) \n result2 = 0\n for i in range(iSize-1,-1,-1):\n result2 +=my_matrix[i][i]\n sum_list.append(result2)\n if len(set(sum_list))>1:\n return False\n return True",
"test_imports": [],
"test_list": [
"assert magic_square_test([[7, 12, 1, 14], [2, 13, 8, 11], [16, 3, 10, 5], [9, 6, 15, 4]])==True",
"assert magic_square_test([[2, 7, 6], [9, 5, 1], [4, 3, 8]])==True",
"assert magic_square_test([[2, 7, 6], [9, 5, 1], [4, 3, 7]])==False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"7 12 1 14\n2 13 8 11\n16 3 10 5\n9 6 15 4\n",
"2 7 6\n9 5 1\n4 3 8\n",
"2 7 6\n9 5 1\n4 3 7\n"
],
"test_output": [
"True\n",
"True\n",
"False\n"
],
"example_input": [
"7 12 1 14\n2 13 8 11\n16 3 10 5\n9 6 15 4\n",
"2 7 6\n9 5 1\n4 3 8\n"
],
"example_output": [
"True\n",
"True\n"
],
"question": "Original problem description:\nWrite a function to calculate whether the matrix is a magic square.\nWe have its functional test sample:\nassert magic_square_test([[7, 12, 1, 14], [2, 13, 8, 11], [16, 3, 10, 5], [9, 6, 15, 4]])==True\nassert magic_square_test([[2, 7, 6], [9, 5, 1], [4, 3, 8]])==True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n7 12 1 14\n2 13 8 11\n16 3 10 5\n9 6 15 4\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n2 7 6\n9 5 1\n4 3 8\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 71,
"prompt": "Write a function to find the item with maximum frequency in a given list.",
"code": "from collections import defaultdict\ndef max_occurrences(nums):\n dict = defaultdict(int)\n for i in nums:\n dict[i] += 1\n result = max(dict.items(), key=lambda x: x[1]) \n return result[0]",
"test_imports": [],
"test_list": [
"assert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,2,4,6,9,1,2])==2",
"assert max_occurrences([2,3,8,4,7,9,8,7,9,15,14,10,12,13,16,18])==8",
"assert max_occurrences([10,20,20,30,40,90,80,50,30,20,50,10])==20"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2 3 8 4 7 9 8 2 6 5 1 6 1 2 3 2 4 6 9 1 2\n",
"2 3 8 4 7 9 8 7 9 15 14 10 12 13 16 18\n",
"10 20 20 30 40 90 80 50 30 20 50 10\n"
],
"test_output": [
"2\n",
"8\n",
"20\n"
],
"example_input": [
"2 3 8 4 7 9 8 2 6 5 1 6 1 2 3 2 4 6 9 1 2\n",
"2 3 8 4 7 9 8 7 9 15 14 10 12 13 16 18\n"
],
"example_output": [
"2\n",
"8\n"
],
"question": "Original problem description:\nWrite a function to find the item with maximum frequency in a given list.\nWe have its functional test sample:\nassert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,2,4,6,9,1,2])==2\nassert max_occurrences([2,3,8,4,7,9,8,7,9,15,14,10,12,13,16,18])==8\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2 3 8 4 7 9 8 2 6 5 1 6 1 2 3 2 4 6 9 1 2\n\nOutput:\n2\n\n\nExample 2:\nInput:\n2 3 8 4 7 9 8 7 9 15 14 10 12 13 16 18\n\nOutput:\n8\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 72,
"prompt": "Write a python function to reverse only the vowels of a given string (where y is not a vowel).",
"code": "def reverse_vowels(str1):\n\tvowels = \"\"\n\tfor char in str1:\n\t\tif char in \"aeiouAEIOU\":\n\t\t\tvowels += char\n\tresult_string = \"\"\n\tfor char in str1:\n\t\tif char in \"aeiouAEIOU\":\n\t\t\tresult_string += vowels[-1]\n\t\t\tvowels = vowels[:-1]\n\t\telse:\n\t\t\tresult_string += char\n\treturn result_string",
"test_imports": [],
"test_list": [
"assert reverse_vowels(\"Python\") == \"Python\"",
"assert reverse_vowels(\"USA\") == \"ASU\"",
"assert reverse_vowels(\"ab\") == \"ab\""
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Python\n",
"USA\n",
"ab\n"
],
"test_output": [
"Python\n",
"ASU\n",
"ab\n"
],
"example_input": [
"Python\n",
"USA\n"
],
"example_output": [
"Python\n",
"ASU\n"
],
"question": "Original problem description:\nWrite a python function to reverse only the vowels of a given string (where y is not a vowel).\nWe have its functional test sample:\nassert reverse_vowels(\"Python\") == \"Python\"\nassert reverse_vowels(\"USA\") == \"ASU\"\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nPython\n\nOutput:\nPython\n\n\nExample 2:\nInput:\nUSA\n\nOutput:\nASU\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 73,
"prompt": "Write a function to convert a tuple to a string.",
"code": "def tup_string(tup1):\n str = ''.join(tup1)\n return str",
"test_imports": [],
"test_list": [
"assert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==(\"exercises\")",
"assert tup_string(('p','y','t','h','o','n'))==(\"python\")",
"assert tup_string(('p','r','o','g','r','a','m'))==(\"program\")"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"e\nx\ne\nr\nc\ni\ns\ne\ns\n",
"p\ny\nt\nh\no\nn\n",
"p\nr\no\ng\nr\na\nm\n"
],
"test_output": [
"exercises\n",
"python\n",
"program\n"
],
"example_input": [
"e\nx\ne\nr\nc\ni\ns\ne\ns\n",
"p\ny\nt\nh\no\nn\n"
],
"example_output": [
"exercises\n",
"python\n"
],
"question": "Original problem description:\nWrite a function to convert a tuple to a string.\nWe have its functional test sample:\nassert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==(\"exercises\")\nassert tup_string(('p','y','t','h','o','n'))==(\"python\")\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\ne\nx\ne\nr\nc\ni\ns\ne\ns\n\nOutput:\nexercises\n\n\nExample 2:\nInput:\np\ny\nt\nh\no\nn\n\nOutput:\npython\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 74,
"prompt": "Write a function to calculate the sum of the negative numbers of a given list of numbers.",
"code": "def sum_negativenum(nums):\n sum_negativenum = list(filter(lambda nums:nums<0,nums))\n return sum(sum_negativenum)",
"test_imports": [],
"test_list": [
"assert sum_negativenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==-32",
"assert sum_negativenum([10,15,-14,13,-18,12,-20])==-52",
"assert sum_negativenum([19, -65, 57, 39, 152,-639, 121, 44, 90, -190])==-894"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2 4 -6 -9 11 -12 14 -5 17\n",
"10 15 -14 13 -18 12 -20\n",
"19 -65 57 39 152 -639 121 44 90 -190\n"
],
"test_output": [
"-32\n",
"-52\n",
"-894\n"
],
"example_input": [
"2 4 -6 -9 11 -12 14 -5 17\n",
"10 15 -14 13 -18 12 -20\n"
],
"example_output": [
"-32\n",
"-52\n"
],
"question": "Original problem description:\nWrite a function to calculate the sum of the negative numbers of a given list of numbers.\nWe have its functional test sample:\nassert sum_negativenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==-32\nassert sum_negativenum([10,15,-14,13,-18,12,-20])==-52\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2 4 -6 -9 11 -12 14 -5 17\n\nOutput:\n-32\n\n\nExample 2:\nInput:\n10 15 -14 13 -18 12 -20\n\nOutput:\n-52\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 75,
"prompt": "Write a function to find the nth hexagonal number.",
"code": "def hexagonal_num(n): \n\treturn n*(2*n - 1) ",
"test_imports": [],
"test_list": [
"assert hexagonal_num(10) == 190",
"assert hexagonal_num(5) == 45",
"assert hexagonal_num(7) == 91"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n",
"5\n",
"7\n"
],
"test_output": [
"190\n",
"45\n",
"91\n"
],
"example_input": [
"10\n",
"5\n"
],
"example_output": [
"190\n",
"45\n"
],
"question": "Original problem description:\nWrite a function to find the nth hexagonal number.\nWe have its functional test sample:\nassert hexagonal_num(10) == 190\nassert hexagonal_num(5) == 45\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n\nOutput:\n190\n\n\nExample 2:\nInput:\n5\n\nOutput:\n45\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 77,
"prompt": "Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not.",
"code": "def is_Sum_Of_Powers_Of_Two(n): \n if (n % 2 == 1): \n return False\n else: \n return True",
"test_imports": [],
"test_list": [
"assert is_Sum_Of_Powers_Of_Two(10) == True",
"assert is_Sum_Of_Powers_Of_Two(7) == False",
"assert is_Sum_Of_Powers_Of_Two(14) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n",
"7\n",
"14\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"10\n",
"7\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not.\nWe have its functional test sample:\nassert is_Sum_Of_Powers_Of_Two(10) == True\nassert is_Sum_Of_Powers_Of_Two(7) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n7\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 79,
"prompt": "Write a function to flatten the list of lists into a single set of numbers.",
"code": "def extract_singly(test_list):\n res = []\n temp = set()\n for inner in test_list:\n for ele in inner:\n if not ele in temp:\n temp.add(ele)\n res.append(ele)\n return (res) ",
"test_imports": [],
"test_list": [
"assert set(extract_singly([(3, 4, 5), (4, 5, 7), (1, 4)])) == set([3, 4, 5, 7, 1])",
"assert set(extract_singly([(1, 2, 3), (4, 2, 3), (7, 8)])) == set([1, 2, 3, 4, 7, 8])",
"assert set(extract_singly([(7, 8, 9), (10, 11, 12), (10, 11)])) == set([7, 8, 9, 10, 11, 12])"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3 4 5\n4 5 7\n1 4\n",
"1 2 3\n4 2 3\n7 8\n",
"7 8 9\n10 11 12\n10 11\n"
],
"test_output": [
"3 4 5 7 1\n",
"1 2 3 4 7 8\n",
"7 8 9 10 11 12\n"
],
"example_input": [
"3 4 5\n4 5 7\n1 4\n",
"1 2 3\n4 2 3\n7 8\n"
],
"example_output": [
"3 4 5 7 1\n",
"1 2 3 4 7 8\n"
],
"question": "Original problem description:\nWrite a function to flatten the list of lists into a single set of numbers.\nWe have its functional test sample:\nassert set(extract_singly([(3, 4, 5), (4, 5, 7), (1, 4)])) == set([3, 4, 5, 7, 1])\nassert set(extract_singly([(1, 2, 3), (4, 2, 3), (7, 8)])) == set([1, 2, 3, 4, 7, 8])\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3 4 5\n4 5 7\n1 4\n\nOutput:\n3 4 5 7 1\n\n\nExample 2:\nInput:\n1 2 3\n4 2 3\n7 8\n\nOutput:\n1 2 3 4 7 8\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 80,
"prompt": "Write a function to sort a list of elements.",
"code": "def pancake_sort(nums):\n arr_len = len(nums)\n while arr_len > 1:\n mi = nums.index(max(nums[0:arr_len]))\n nums = nums[mi::-1] + nums[mi+1:len(nums)]\n nums = nums[arr_len-1::-1] + nums[arr_len:len(nums)]\n arr_len -= 1\n return nums",
"test_imports": [],
"test_list": [
"assert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]",
"assert pancake_sort([98, 12, 54, 36, 85]) == [12, 36, 54, 85, 98]",
"assert pancake_sort([41, 42, 32, 12, 23]) == [12, 23, 32, 41, 42]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"15 79 25 38 69\n",
"98 12 54 36 85\n",
"41 42 32 12 23\n"
],
"test_output": [
"15 25 38 69 79\n",
"12 36 54 85 98\n",
"12 23 32 41 42\n"
],
"example_input": [
"15 79 25 38 69\n",
"98 12 54 36 85\n"
],
"example_output": [
"15 25 38 69 79\n",
"12 36 54 85 98\n"
],
"question": "Original problem description:\nWrite a function to sort a list of elements.\nWe have its functional test sample:\nassert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]\nassert pancake_sort([98, 12, 54, 36, 85]) == [12, 36, 54, 85, 98]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n15 79 25 38 69\n\nOutput:\n15 25 38 69 79\n\n\nExample 2:\nInput:\n98 12 54 36 85\n\nOutput:\n12 36 54 85 98\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 81,
"prompt": "Write a function to count number items that are identical in the same position of three given lists.",
"code": "def count_samepair(list1,list2,list3):\n result = sum(m == n == o for m, n, o in zip(list1,list2,list3))\n return result",
"test_imports": [],
"test_list": [
"assert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,9],[2,1,3,1,2,6,7,9])==3",
"assert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,8],[2,1,3,1,2,6,7,8])==4",
"assert count_samepair([1,2,3,4,2,6,7,8],[2,2,3,1,2,6,7,8],[2,1,3,1,2,6,7,8])==5"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5 6 7 8\n2 2 3 1 2 6 7 9\n2 1 3 1 2 6 7 9\n",
"1 2 3 4 5 6 7 8\n2 2 3 1 2 6 7 8\n2 1 3 1 2 6 7 8\n",
"1 2 3 4 2 6 7 8\n2 2 3 1 2 6 7 8\n2 1 3 1 2 6 7 8\n"
],
"test_output": [
"3\n",
"4\n",
"5\n"
],
"example_input": [
"1 2 3 4 5 6 7 8\n2 2 3 1 2 6 7 9\n2 1 3 1 2 6 7 9\n",
"1 2 3 4 5 6 7 8\n2 2 3 1 2 6 7 8\n2 1 3 1 2 6 7 8\n"
],
"example_output": [
"3\n",
"4\n"
],
"question": "Original problem description:\nWrite a function to count number items that are identical in the same position of three given lists.\nWe have its functional test sample:\nassert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,9],[2,1,3,1,2,6,7,9])==3\nassert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,8],[2,1,3,1,2,6,7,8])==4\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5 6 7 8\n2 2 3 1 2 6 7 9\n2 1 3 1 2 6 7 9\n\nOutput:\n3\n\n\nExample 2:\nInput:\n1 2 3 4 5 6 7 8\n2 2 3 1 2 6 7 8\n2 1 3 1 2 6 7 8\n\nOutput:\n4\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 82,
"prompt": "Write a function to find number of lists present in the given tuple.",
"code": "def find_lists(Input): \n\tif isinstance(Input, list): \n\t\treturn 1\n\telse: \n\t\treturn len(Input) ",
"test_imports": [],
"test_list": [
"assert find_lists(([1, 2, 3, 4], [5, 6, 7, 8])) == 2",
"assert find_lists(([1, 2], [3, 4], [5, 6])) == 3",
"assert find_lists(([9, 8, 7, 6, 5, 4, 3, 2, 1])) == 1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4\n5 6 7 8\n",
"1 2\n3 4\n5 6\n",
"9 8 7 6 5 4 3 2 1\n"
],
"test_output": [
"2\n",
"3\n",
"1\n"
],
"example_input": [
"1 2 3 4\n5 6 7 8\n",
"1 2\n3 4\n5 6\n"
],
"example_output": [
"2\n",
"3\n"
],
"question": "Original problem description:\nWrite a function to find number of lists present in the given tuple.\nWe have its functional test sample:\nassert find_lists(([1, 2, 3, 4], [5, 6, 7, 8])) == 2\nassert find_lists(([1, 2], [3, 4], [5, 6])) == 3\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4\n5 6 7 8\n\nOutput:\n2\n\n\nExample 2:\nInput:\n1 2\n3 4\n5 6\n\nOutput:\n3\n\n\n"
},
{
"source_file": "Mike's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 83,
"prompt": "Write a python function to find the maximum difference between any two elements in a given array.",
"code": "def max_Abs_Diff(arr): \n n = len(arr)\n minEle = arr[0] \n maxEle = arr[0] \n for i in range(1, n): \n minEle = min(minEle,arr[i]) \n maxEle = max(maxEle,arr[i]) \n return (maxEle - minEle) ",
"test_imports": [],
"test_list": [
"assert max_Abs_Diff((2,1,5,3)) == 4",
"assert max_Abs_Diff((9,3,2,5,1)) == 8",
"assert max_Abs_Diff((3,2,1)) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n1\n5\n3\n",
"9\n3\n2\n5\n1\n",
"3\n2\n1\n"
],
"test_output": [
"4\n",
"8\n",
"2\n"
],
"example_input": [
"2\n1\n5\n3\n",
"9\n3\n2\n5\n1\n"
],
"example_output": [
"4\n",
"8\n"
],
"question": "Original problem description:\nWrite a python function to find the maximum difference between any two elements in a given array.\nWe have its functional test sample:\nassert max_Abs_Diff((2,1,5,3)) == 4\nassert max_Abs_Diff((9,3,2,5,1)) == 8\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n1\n5\n3\n\nOutput:\n4\n\n\nExample 2:\nInput:\n9\n3\n2\n5\n1\n\nOutput:\n8\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 84,
"prompt": "Write a function that returns integers x and y that satisfy ax + by = n as a tuple, or return None if no solution exists.",
"code": "def find_solution(a, b, n):\n\ti = 0\n\twhile i * a <= n:\n\t\tif (n - (i * a)) % b == 0: \n\t\t\treturn (i, (n - (i * a)) // b)\n\t\ti = i + 1\n\treturn None",
"test_imports": [],
"test_list": [
"assert find_solution(2, 3, 7) == (2, 1)",
"assert find_solution(4, 2, 7) == None",
"assert find_solution(1, 13, 17) == (4, 1)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n3\n7\n",
"4\n2\n7\n",
"1\n13\n17\n"
],
"test_output": [
"2 1\n",
"None\n",
"4 1\n"
],
"example_input": [
"2\n3\n7\n",
"4\n2\n7\n"
],
"example_output": [
"2 1\n",
"None\n"
],
"question": "Original problem description:\nWrite a function that returns integers x and y that satisfy ax + by = n as a tuple, or return None if no solution exists.\nWe have its functional test sample:\nassert find_solution(2, 3, 7) == (2, 1)\nassert find_solution(4, 2, 7) == None\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n3\n7\n\nOutput:\n2 1\n\n\nExample 2:\nInput:\n4\n2\n7\n\nOutput:\nNone\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 85,
"prompt": "Write a function to remove all elements from a given list present in another list.",
"code": "def remove_elements(list1, list2):\n result = [x for x in list1 if x not in list2]\n return result",
"test_imports": [],
"test_list": [
"assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 4, 6, 8]) == [1, 3, 5, 7, 9, 10]",
"assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7]) == [2, 4, 6, 8, 9, 10]",
"assert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [5, 7]) == [1, 2, 3, 4, 6, 8, 9, 10]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5 6 7 8 9 10\n2 4 6 8\n",
"1 2 3 4 5 6 7 8 9 10\n1 3 5 7\n",
"1 2 3 4 5 6 7 8 9 10\n5 7\n"
],
"test_output": [
"1 3 5 7 9 10\n",
"2 4 6 8 9 10\n",
"1 2 3 4 6 8 9 10\n"
],
"example_input": [
"1 2 3 4 5 6 7 8 9 10\n2 4 6 8\n",
"1 2 3 4 5 6 7 8 9 10\n1 3 5 7\n"
],
"example_output": [
"1 3 5 7 9 10\n",
"2 4 6 8 9 10\n"
],
"question": "Original problem description:\nWrite a function to remove all elements from a given list present in another list.\nWe have its functional test sample:\nassert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 4, 6, 8]) == [1, 3, 5, 7, 9, 10]\nassert remove_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7]) == [2, 4, 6, 8, 9, 10]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5 6 7 8 9 10\n2 4 6 8\n\nOutput:\n1 3 5 7 9 10\n\n\nExample 2:\nInput:\n1 2 3 4 5 6 7 8 9 10\n1 3 5 7\n\nOutput:\n2 4 6 8 9 10\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 86,
"prompt": "Write a function to calculate the sum (n - 2*i) from i=0 to n // 2, for instance n + (n-2) + (n-4)... (until n-x =< 0).",
"code": "def sum_series(n):\n if n < 1:\n return 0\n else:\n return n + sum_series(n - 2)",
"test_imports": [],
"test_list": [
"assert sum_series(6) == 12",
"assert sum_series(10) == 30",
"assert sum_series(9) == 25"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"6\n",
"10\n",
"9\n"
],
"test_output": [
"12\n",
"30\n",
"25\n"
],
"example_input": [
"6\n",
"10\n"
],
"example_output": [
"12\n",
"30\n"
],
"question": "Original problem description:\nWrite a function to calculate the sum (n - 2*i) from i=0 to n // 2, for instance n + (n-2) + (n-4)... (until n-x =< 0).\nWe have its functional test sample:\nassert sum_series(6) == 12\nassert sum_series(10) == 30\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n6\n\nOutput:\n12\n\n\nExample 2:\nInput:\n10\n\nOutput:\n30\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 88,
"prompt": "Write a function to determine if the sum of the divisors of two integers are the same.",
"code": "import math \ndef div_sum(n): \n total = 1\n i = 2\n\n while i * i <= n:\n if (n % i == 0):\n total = (total + i + math.floor(n / i))\n i += 1\n\n return total\n\ndef are_equivalent(num1, num2): \n return div_sum(num1) == div_sum(num2); ",
"test_imports": [],
"test_list": [
"assert are_equivalent(36, 57) == False",
"assert are_equivalent(2, 4) == False",
"assert are_equivalent(23, 47) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"36\n57\n",
"2\n4\n",
"23\n47\n"
],
"test_output": [
"False\n",
"False\n",
"True\n"
],
"example_input": [
"36\n57\n",
"2\n4\n"
],
"example_output": [
"False\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to determine if the sum of the divisors of two integers are the same.\nWe have its functional test sample:\nassert are_equivalent(36, 57) == False\nassert are_equivalent(2, 4) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n36\n57\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n2\n4\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 89,
"prompt": "Write a function to count the number of characters in a string that occur at the same position in the string as in the English alphabet (case insensitive).",
"code": "def count_char_position(str1): \n count_chars = 0\n for i in range(len(str1)):\n if ((i == ord(str1[i]) - ord('A')) or \n (i == ord(str1[i]) - ord('a'))): \n count_chars += 1\n return count_chars ",
"test_imports": [],
"test_list": [
"assert count_char_position(\"xbcefg\") == 2",
"assert count_char_position(\"ABcED\") == 3",
"assert count_char_position(\"AbgdeF\") == 5"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"xbcefg\n",
"ABcED\n",
"AbgdeF\n"
],
"test_output": [
"2\n",
"3\n",
"5\n"
],
"example_input": [
"xbcefg\n",
"ABcED\n"
],
"example_output": [
"2\n",
"3\n"
],
"question": "Original problem description:\nWrite a function to count the number of characters in a string that occur at the same position in the string as in the English alphabet (case insensitive).\nWe have its functional test sample:\nassert count_char_position(\"xbcefg\") == 2\nassert count_char_position(\"ABcED\") == 3\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nxbcefg\n\nOutput:\n2\n\n\nExample 2:\nInput:\nABcED\n\nOutput:\n3\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 90,
"prompt": "Write a function that counts the number of pairs of integers in a list that xor to an even number.",
"code": "def find_even_pair(A): \n count = 0\n for i in range(0, len(A)): \n for j in range(i+1, len(A)): \n if ((A[i] ^ A[j]) % 2 == 0): \n count += 1\n\n return count",
"test_imports": [],
"test_list": [
"assert find_even_pair([5, 4, 7, 2, 1]) == 4",
"assert find_even_pair([7, 2, 8, 1, 0, 5, 11]) == 9",
"assert find_even_pair([1, 2, 3]) == 1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5 4 7 2 1\n",
"7 2 8 1 0 5 11\n",
"1 2 3\n"
],
"test_output": [
"4\n",
"9\n",
"1\n"
],
"example_input": [
"5 4 7 2 1\n",
"7 2 8 1 0 5 11\n"
],
"example_output": [
"4\n",
"9\n"
],
"question": "Original problem description:\nWrite a function that counts the number of pairs of integers in a list that xor to an even number.\nWe have its functional test sample:\nassert find_even_pair([5, 4, 7, 2, 1]) == 4\nassert find_even_pair([7, 2, 8, 1, 0, 5, 11]) == 9\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5 4 7 2 1\n\nOutput:\n4\n\n\nExample 2:\nInput:\n7 2 8 1 0 5 11\n\nOutput:\n9\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 91,
"prompt": "Write a python function to find the smallest power of 2 greater than or equal to n.",
"code": "def next_power_of_2(n): \n if n and not n & (n - 1):\n return n\n\n count = 0\n while n != 0: \n n >>= 1\n count += 1\n\n return 1 << count; ",
"test_imports": [],
"test_list": [
"assert next_power_of_2(0) == 1",
"assert next_power_of_2(5) == 8",
"assert next_power_of_2(17) == 32"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"0\n",
"5\n",
"17\n"
],
"test_output": [
"1\n",
"8\n",
"32\n"
],
"example_input": [
"0\n",
"5\n"
],
"example_output": [
"1\n",
"8\n"
],
"question": "Original problem description:\nWrite a python function to find the smallest power of 2 greater than or equal to n.\nWe have its functional test sample:\nassert next_power_of_2(0) == 1\nassert next_power_of_2(5) == 8\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n0\n\nOutput:\n1\n\n\nExample 2:\nInput:\n5\n\nOutput:\n8\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 92,
"prompt": "Write a function to count the number of occurrences of a number in a given list.",
"code": "def frequency(a,x): \n count = 0 \n for i in a: \n if i == x: \n count += 1\n\n return count ",
"test_imports": [],
"test_list": [
"assert frequency([1,2,3], 4) == 0",
"assert frequency([1,2,2,3,3,3,4], 3) == 3",
"assert frequency([0,1,2,3,1,2], 1) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3\n4\n",
"1 2 2 3 3 3 4\n3\n",
"0 1 2 3 1 2\n1\n"
],
"test_output": [
"0\n",
"3\n",
"2\n"
],
"example_input": [
"1 2 3\n4\n",
"1 2 2 3 3 3 4\n3\n"
],
"example_output": [
"0\n",
"3\n"
],
"question": "Original problem description:\nWrite a function to count the number of occurrences of a number in a given list.\nWe have its functional test sample:\nassert frequency([1,2,3], 4) == 0\nassert frequency([1,2,2,3,3,3,4], 3) == 3\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3\n4\n\nOutput:\n0\n\n\nExample 2:\nInput:\n1 2 2 3 3 3 4\n3\n\nOutput:\n3\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 93,
"prompt": "Write a function to find the sum of numbers in a list within a range specified by two indices.",
"code": "def sum_range_list(list1, m, n): \n sum_range = 0 \n for i in range(m, n+1, 1): \n sum_range += list1[i] \n return sum_range ",
"test_imports": [],
"test_list": [
"assert sum_range_list([2,1,5,6,8,3,4,9,10,11,8,12], 8, 10) == 29",
"assert sum_range_list([2,1,5,6,8,3,4,9,10,11,8,12], 5, 7) == 16",
"assert sum_range_list([2,1,5,6,8,3,4,9,10,11,8,12], 7, 10) == 38"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2 1 5 6 8 3 4 9 10 11 8 12\n8\n10\n",
"2 1 5 6 8 3 4 9 10 11 8 12\n5\n7\n",
"2 1 5 6 8 3 4 9 10 11 8 12\n7\n10\n"
],
"test_output": [
"29\n",
"16\n",
"38\n"
],
"example_input": [
"2 1 5 6 8 3 4 9 10 11 8 12\n8\n10\n",
"2 1 5 6 8 3 4 9 10 11 8 12\n5\n7\n"
],
"example_output": [
"29\n",
"16\n"
],
"question": "Original problem description:\nWrite a function to find the sum of numbers in a list within a range specified by two indices.\nWe have its functional test sample:\nassert sum_range_list([2,1,5,6,8,3,4,9,10,11,8,12], 8, 10) == 29\nassert sum_range_list([2,1,5,6,8,3,4,9,10,11,8,12], 5, 7) == 16\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2 1 5 6 8 3 4 9 10 11 8 12\n8\n10\n\nOutput:\n29\n\n\nExample 2:\nInput:\n2 1 5 6 8 3 4 9 10 11 8 12\n5\n7\n\nOutput:\n16\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 94,
"prompt": "Write a function to find the perimeter of a regular pentagon from the length of its sides.",
"code": "import math\ndef perimeter_pentagon(a):\n perimeter=(5*a)\n return perimeter",
"test_imports": [],
"test_list": [
"assert perimeter_pentagon(5) == 25",
"assert perimeter_pentagon(10) == 50",
"assert perimeter_pentagon(15) == 75"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n",
"10\n",
"15\n"
],
"test_output": [
"25\n",
"50\n",
"75\n"
],
"example_input": [
"5\n",
"10\n"
],
"example_output": [
"25\n",
"50\n"
],
"question": "Original problem description:\nWrite a function to find the perimeter of a regular pentagon from the length of its sides.\nWe have its functional test sample:\nassert perimeter_pentagon(5) == 25\nassert perimeter_pentagon(10) == 50\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n\nOutput:\n25\n\n\nExample 2:\nInput:\n10\n\nOutput:\n50\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 95,
"prompt": "Write a function to count the number of occurence of the string 'std' in a given string.",
"code": "def count_occurance(s):\n count = 0\n for i in range(len(s) - 2):\n if (s[i] == 's' and s[i+1] == 't' and s[i+2] == 'd'):\n count = count + 1\n return count",
"test_imports": [],
"test_list": [
"assert count_occurance(\"letstdlenstdporstd\") == 3",
"assert count_occurance(\"truststdsolensporsd\") == 1",
"assert count_occurance(\"makestdsostdworthit\") == 2",
"assert count_occurance(\"stds\") == 1",
"assert count_occurance(\"\") == 0"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"letstdlenstdporstd\n",
"truststdsolensporsd\n",
"makestdsostdworthit\n",
"stds\n",
"\n"
],
"test_output": [
"3\n",
"1\n",
"2\n",
"1\n",
"0\n"
],
"example_input": [
"letstdlenstdporstd\n",
"truststdsolensporsd\n"
],
"example_output": [
"3\n",
"1\n"
],
"question": "Original problem description:\nWrite a function to count the number of occurence of the string 'std' in a given string.\nWe have its functional test sample:\nassert count_occurance(\"letstdlenstdporstd\") == 3\nassert count_occurance(\"truststdsolensporsd\") == 1\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nletstdlenstdporstd\n\nOutput:\n3\n\n\nExample 2:\nInput:\ntruststdsolensporsd\n\nOutput:\n1\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 96,
"prompt": "Write a function to check if all the elements in tuple have same data type or not.",
"code": "def check_type(test_tuple):\n res = True\n for ele in test_tuple:\n if not isinstance(ele, type(test_tuple[0])):\n res = False\n break\n return (res) ",
"test_imports": [],
"test_list": [
"assert check_type((5, 6, 7, 3, 5, 6) ) == True",
"assert check_type((1, 2, \"4\") ) == False",
"assert check_type((3, 2, 1, 4, 5) ) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n6\n7\n3\n5\n6\n",
"1\n2\n4\n",
"3\n2\n1\n4\n5\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"5\n6\n7\n3\n5\n6\n",
"1\n2\n4\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to check if all the elements in tuple have same data type or not.\nWe have its functional test sample:\nassert check_type((5, 6, 7, 3, 5, 6) ) == True\nassert check_type((1, 2, \"4\") ) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n6\n7\n3\n5\n6\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n1\n2\n4\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 97,
"prompt": "Write a function that takes in a sorted array, its length (n), and an element and returns whether the element is the majority element in the given sorted array. (The majority element is the element that occurs more than n/2 times.)",
"code": "def is_majority(arr, n, x):\n\ti = binary_search(arr, 0, n-1, x)\n\tif i == -1:\n\t\treturn False\n\tif ((i + n//2) <= (n -1)) and arr[i + n//2] == x:\n\t\treturn True\n\telse:\n\t\treturn False\ndef binary_search(arr, low, high, x):\n\tif high >= low:\n\t\tmid = (low + high)//2 \n\t\tif (mid == 0 or x > arr[mid-1]) and (arr[mid] == x):\n\t\t\treturn mid\n\t\telif x > arr[mid]:\n\t\t\treturn binary_search(arr, (mid + 1), high, x)\n\t\telse:\n\t\t\treturn binary_search(arr, low, (mid -1), x)\n\treturn -1",
"test_imports": [],
"test_list": [
"assert is_majority([1, 2, 3, 3, 3, 3, 10], 7, 3) == True",
"assert is_majority([1, 1, 2, 4, 4, 4, 6, 6], 8, 4) == False",
"assert is_majority([1, 1, 1, 2, 2], 5, 1) == True",
"assert is_majority([1, 1, 2, 2], 5, 1) == False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 3 3 3 10\n7\n3\n",
"1 1 2 4 4 4 6 6\n8\n4\n",
"1 1 1 2 2\n5\n1\n",
"1 1 2 2\n5\n1\n"
],
"test_output": [
"True\n",
"False\n",
"True\n",
"False\n"
],
"example_input": [
"1 2 3 3 3 3 10\n7\n3\n",
"1 1 2 4 4 4 6 6\n8\n4\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function that takes in a sorted array, its length (n), and an element and returns whether the element is the majority element in the given sorted array. (The majority element is the element that occurs more than n/2 times.)\nWe have its functional test sample:\nassert is_majority([1, 2, 3, 3, 3, 3, 10], 7, 3) == True\nassert is_majority([1, 1, 2, 4, 4, 4, 6, 6], 8, 4) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 3 3 3 10\n7\n3\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n1 1 2 4 4 4 6 6\n8\n4\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 98,
"prompt": "Write a python function to count the number of set bits (binary digits with value 1) in a given number.",
"code": "def count_Set_Bits(n): \n count = 0\n while (n): \n count += n & 1\n n >>= 1\n return count ",
"test_imports": [],
"test_list": [
"assert count_Set_Bits(2) == 1",
"assert count_Set_Bits(4) == 1",
"assert count_Set_Bits(6) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n",
"4\n",
"6\n"
],
"test_output": [
"1\n",
"1\n",
"2\n"
],
"example_input": [
"2\n",
"4\n"
],
"example_output": [
"1\n",
"1\n"
],
"question": "Original problem description:\nWrite a python function to count the number of set bits (binary digits with value 1) in a given number.\nWe have its functional test sample:\nassert count_Set_Bits(2) == 1\nassert count_Set_Bits(4) == 1\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n\nOutput:\n1\n\n\nExample 2:\nInput:\n4\n\nOutput:\n1\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 99,
"prompt": "Write a python function to remove the characters which have odd index values of a given string.",
"code": "def odd_values_string(str):\n result = \"\" \n for i in range(len(str)):\n if i % 2 == 0:\n result = result + str[i]\n return result",
"test_imports": [],
"test_list": [
"assert odd_values_string('abcdef') == 'ace'",
"assert odd_values_string('python') == 'pto'",
"assert odd_values_string('data') == 'dt'",
"assert odd_values_string('lambs') == 'lms'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"abcdef\n",
"python\n",
"data\n",
"lambs\n"
],
"test_output": [
"ace\n",
"pto\n",
"dt\n",
"lms\n"
],
"example_input": [
"abcdef\n",
"python\n"
],
"example_output": [
"ace\n",
"pto\n"
],
"question": "Original problem description:\nWrite a python function to remove the characters which have odd index values of a given string.\nWe have its functional test sample:\nassert odd_values_string('abcdef') == 'ace'\nassert odd_values_string('python') == 'pto'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nabcdef\n\nOutput:\nace\n\n\nExample 2:\nInput:\npython\n\nOutput:\npto\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 100,
"prompt": "Write a function to find minimum of three numbers.",
"code": "def min_of_three(a,b,c): \n if (a <= b) and (a <= c): \n smallest = a \n elif (b <= a) and (b <= c): \n smallest = b \n else: \n smallest = c \n return smallest ",
"test_imports": [],
"test_list": [
"assert min_of_three(10,20,0)==0",
"assert min_of_three(19,15,18)==15",
"assert min_of_three(-10,-20,-30)==-30"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n20\n0\n",
"19\n15\n18\n",
"-10\n-20\n-30\n"
],
"test_output": [
"0\n",
"15\n",
"-30\n"
],
"example_input": [
"10\n20\n0\n",
"19\n15\n18\n"
],
"example_output": [
"0\n",
"15\n"
],
"question": "Original problem description:\nWrite a function to find minimum of three numbers.\nWe have its functional test sample:\nassert min_of_three(10,20,0)==0\nassert min_of_three(19,15,18)==15\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n20\n0\n\nOutput:\n0\n\n\nExample 2:\nInput:\n19\n15\n18\n\nOutput:\n15\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 101,
"prompt": "Write a python function to check whether all the bits are unset in the given range or not.",
"code": "def all_Bits_Set_In_The_Given_Range(n,l,r): \n num = (((1 << r) - 1) ^ ((1 << (l - 1)) - 1)) \n new_num = n & num\n if (new_num == 0): \n return True\n return False",
"test_imports": [],
"test_list": [
"assert all_Bits_Set_In_The_Given_Range(4,1,2) == True",
"assert all_Bits_Set_In_The_Given_Range(17,2,4) == True",
"assert all_Bits_Set_In_The_Given_Range(39,4,6) == False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"4\n1\n2\n",
"17\n2\n4\n",
"39\n4\n6\n"
],
"test_output": [
"True\n",
"True\n",
"False\n"
],
"example_input": [
"4\n1\n2\n",
"17\n2\n4\n"
],
"example_output": [
"True\n",
"True\n"
],
"question": "Original problem description:\nWrite a python function to check whether all the bits are unset in the given range or not.\nWe have its functional test sample:\nassert all_Bits_Set_In_The_Given_Range(4,1,2) == True\nassert all_Bits_Set_In_The_Given_Range(17,2,4) == True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n4\n1\n2\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n17\n2\n4\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 102,
"prompt": "Write a function that takes in an array and an integer n, and re-arranges the first n elements of the given array so that all negative elements appear before positive ones, and where the relative order among negative and positive elements is preserved.",
"code": "def re_arrange_array(arr, n):\n j=0\n for i in range(0, n):\n if (arr[i] < 0):\n temp = arr[i]\n arr[i] = arr[j]\n arr[j] = temp\n j = j + 1\n return arr",
"test_imports": [],
"test_list": [
"assert re_arrange_array([-1, 2, -3, 4, 5, 6, -7, 8, 9], 9) == [-1, -3, -7, 4, 5, 6, 2, 8, 9]",
"assert re_arrange_array([12, -14, -26, 13, 15], 5) == [-14, -26, 12, 13, 15]",
"assert re_arrange_array([10, 24, 36, -42, -39, -78, 85], 7) == [-42, -39, -78, 10, 24, 36, 85]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"-1 2 -3 4 5 6 -7 8 9\n9\n",
"12 -14 -26 13 15\n5\n",
"10 24 36 -42 -39 -78 85\n7\n"
],
"test_output": [
"-1 -3 -7 4 5 6 2 8 9\n",
"-14 -26 12 13 15\n",
"-42 -39 -78 10 24 36 85\n"
],
"example_input": [
"-1 2 -3 4 5 6 -7 8 9\n9\n",
"12 -14 -26 13 15\n5\n"
],
"example_output": [
"-1 -3 -7 4 5 6 2 8 9\n",
"-14 -26 12 13 15\n"
],
"question": "Original problem description:\nWrite a function that takes in an array and an integer n, and re-arranges the first n elements of the given array so that all negative elements appear before positive ones, and where the relative order among negative and positive elements is preserved.\nWe have its functional test sample:\nassert re_arrange_array([-1, 2, -3, 4, 5, 6, -7, 8, 9], 9) == [-1, -3, -7, 4, 5, 6, 2, 8, 9]\nassert re_arrange_array([12, -14, -26, 13, 15], 5) == [-14, -26, 12, 13, 15]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n-1 2 -3 4 5 6 -7 8 9\n9\n\nOutput:\n-1 -3 -7 4 5 6 2 8 9\n\n\nExample 2:\nInput:\n12 -14 -26 13 15\n5\n\nOutput:\n-14 -26 12 13 15\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 103,
"prompt": "Write a function that takes in a string and character, replaces blank spaces in the string with the character, and returns the string.",
"code": "def replace_blank(str1,char):\n str2 = str1.replace(' ', char)\n return str2",
"test_imports": [],
"test_list": [
"assert replace_blank(\"hello people\",'@')==(\"hello@people\")",
"assert replace_blank(\"python program language\",'$')==(\"python$program$language\")",
"assert replace_blank(\"blank space\",\"-\")==(\"blank-space\")"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"hello people\n@\n",
"python program language\n$\n",
"blank space\n-\n"
],
"test_output": [
"hello@people\n",
"python$program$language\n",
"blank-space\n"
],
"example_input": [
"hello people\n@\n",
"python program language\n$\n"
],
"example_output": [
"hello@people\n",
"python$program$language\n"
],
"question": "Original problem description:\nWrite a function that takes in a string and character, replaces blank spaces in the string with the character, and returns the string.\nWe have its functional test sample:\nassert replace_blank(\"hello people\",'@')==(\"hello@people\")\nassert replace_blank(\"python program language\",'$')==(\"python$program$language\")\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nhello people\n@\n\nOutput:\nhello@people\n\n\nExample 2:\nInput:\npython program language\n$\n\nOutput:\npython$program$language\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 104,
"prompt": "Write a function that takes in a list and an integer n and returns a list containing the n largest items from the list.",
"code": "import heapq\ndef larg_nnum(list1,n):\n largest=heapq.nlargest(n,list1)\n return largest",
"test_imports": [],
"test_list": [
"assert set(larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2))==set([100,90])",
"assert set(larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],5))==set([100,90,80,70,60])",
"assert set(larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],3))==set([100,90,80])"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 20 50 70 90 20 50 40 60 80 100\n2\n",
"10 20 50 70 90 20 50 40 60 80 100\n5\n",
"10 20 50 70 90 20 50 40 60 80 100\n3\n"
],
"test_output": [
"100 90\n",
"100 90 80 70 60\n",
"100 90 80\n"
],
"example_input": [
"10 20 50 70 90 20 50 40 60 80 100\n2\n",
"10 20 50 70 90 20 50 40 60 80 100\n5\n"
],
"example_output": [
"100 90\n",
"100 90 80 70 60\n"
],
"question": "Original problem description:\nWrite a function that takes in a list and an integer n and returns a list containing the n largest items from the list.\nWe have its functional test sample:\nassert set(larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2))==set([100,90])\nassert set(larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],5))==set([100,90,80,70,60])\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 20 50 70 90 20 50 40 60 80 100\n2\n\nOutput:\n100 90\n\n\nExample 2:\nInput:\n10 20 50 70 90 20 50 40 60 80 100\n5\n\nOutput:\n100 90 80 70 60\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 106,
"prompt": "Write a function to find the volume of a cube given its side length.",
"code": "def volume_cube(l):\n volume = l * l * l\n return volume",
"test_imports": [],
"test_list": [
"assert volume_cube(3)==27",
"assert volume_cube(2)==8",
"assert volume_cube(5)==125"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3\n",
"2\n",
"5\n"
],
"test_output": [
"27\n",
"8\n",
"125\n"
],
"example_input": [
"3\n",
"2\n"
],
"example_output": [
"27\n",
"8\n"
],
"question": "Original problem description:\nWrite a function to find the volume of a cube given its side length.\nWe have its functional test sample:\nassert volume_cube(3)==27\nassert volume_cube(2)==8\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3\n\nOutput:\n27\n\n\nExample 2:\nInput:\n2\n\nOutput:\n8\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 107,
"prompt": "Write a python function to set all even bits of a given number.",
"code": "def even_bit_set_number(n): \n count = 0;res = 0;temp = n \n while(temp > 0): \n if (count % 2 == 1): \n res |= (1 << count)\n count+=1\n temp >>= 1\n return (n | res) ",
"test_imports": [],
"test_list": [
"assert even_bit_set_number(10) == 10",
"assert even_bit_set_number(20) == 30",
"assert even_bit_set_number(30) == 30"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n",
"20\n",
"30\n"
],
"test_output": [
"10\n",
"30\n",
"30\n"
],
"example_input": [
"10\n",
"20\n"
],
"example_output": [
"10\n",
"30\n"
],
"question": "Original problem description:\nWrite a python function to set all even bits of a given number.\nWe have its functional test sample:\nassert even_bit_set_number(10) == 10\nassert even_bit_set_number(20) == 30\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n\nOutput:\n10\n\n\nExample 2:\nInput:\n20\n\nOutput:\n30\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 109,
"prompt": "Write a python function to count the number of non-empty substrings of a given string.",
"code": "def number_of_substrings(str): \n\tstr_len = len(str); \n\treturn int(str_len * (str_len + 1) / 2); ",
"test_imports": [],
"test_list": [
"assert number_of_substrings(\"abc\") == 6",
"assert number_of_substrings(\"abcd\") == 10",
"assert number_of_substrings(\"abcde\") == 15"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"abc\n",
"abcd\n",
"abcde\n"
],
"test_output": [
"6\n",
"10\n",
"15\n"
],
"example_input": [
"abc\n",
"abcd\n"
],
"example_output": [
"6\n",
"10\n"
],
"question": "Original problem description:\nWrite a python function to count the number of non-empty substrings of a given string.\nWe have its functional test sample:\nassert number_of_substrings(\"abc\") == 6\nassert number_of_substrings(\"abcd\") == 10\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nabc\n\nOutput:\n6\n\n\nExample 2:\nInput:\nabcd\n\nOutput:\n10\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 110,
"prompt": "Write a function that takes in positive integers m and n and finds the number of possible sequences of length n, such that each element is a positive integer and is greater than or equal to twice the previous element but less than or equal to m.",
"code": "def get_total_number_of_sequences(m,n): \n\tT=[[0 for i in range(n+1)] for i in range(m+1)] \n\tfor i in range(m+1): \n\t\tfor j in range(n+1): \n\t\t\tif i==0 or j==0: \n\t\t\t\tT[i][j]=0\n\t\t\telif i<j: \n\t\t\t\tT[i][j]=0\n\t\t\telif j==1: \n\t\t\t\tT[i][j]=i \n\t\t\telse: \n\t\t\t\tT[i][j]=T[i-1][j]+T[i//2][j-1] \n\treturn T[m][n]",
"test_imports": [],
"test_list": [
"assert get_total_number_of_sequences(10, 4) == 4",
"assert get_total_number_of_sequences(5, 2) == 6",
"assert get_total_number_of_sequences(16, 3) == 84"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n4\n",
"5\n2\n",
"16\n3\n"
],
"test_output": [
"4\n",
"6\n",
"84\n"
],
"example_input": [
"10\n4\n",
"5\n2\n"
],
"example_output": [
"4\n",
"6\n"
],
"question": "Original problem description:\nWrite a function that takes in positive integers m and n and finds the number of possible sequences of length n, such that each element is a positive integer and is greater than or equal to twice the previous element but less than or equal to m.\nWe have its functional test sample:\nassert get_total_number_of_sequences(10, 4) == 4\nassert get_total_number_of_sequences(5, 2) == 6\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n4\n\nOutput:\n4\n\n\nExample 2:\nInput:\n5\n2\n\nOutput:\n6\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 111,
"prompt": "Write a function that takes in two lists and replaces the last element of the first list with the elements of the second list.",
"code": "def replace_list(list1,list2):\n list1[-1:] = list2\n replace_list=list1\n return replace_list\n",
"test_imports": [],
"test_list": [
"assert replace_list([1, 3, 5, 7, 9, 10],[2, 4, 6, 8])==[1, 3, 5, 7, 9, 2, 4, 6, 8]",
"assert replace_list([1,2,3,4,5],[5,6,7,8])==[1,2,3,4,5,6,7,8]",
"assert replace_list([\"red\",\"blue\",\"green\"],[\"yellow\"])==[\"red\",\"blue\",\"yellow\"]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 3 5 7 9 10\n2 4 6 8\n",
"1 2 3 4 5\n5 6 7 8\n",
"red blue green\nyellow\n"
],
"test_output": [
"1 3 5 7 9 2 4 6 8\n",
"1 2 3 4 5 6 7 8\n",
"red blue yellow\n"
],
"example_input": [
"1 3 5 7 9 10\n2 4 6 8\n",
"1 2 3 4 5\n5 6 7 8\n"
],
"example_output": [
"1 3 5 7 9 2 4 6 8\n",
"1 2 3 4 5 6 7 8\n"
],
"question": "Original problem description:\nWrite a function that takes in two lists and replaces the last element of the first list with the elements of the second list.\nWe have its functional test sample:\nassert replace_list([1, 3, 5, 7, 9, 10],[2, 4, 6, 8])==[1, 3, 5, 7, 9, 2, 4, 6, 8]\nassert replace_list([1,2,3,4,5],[5,6,7,8])==[1,2,3,4,5,6,7,8]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 3 5 7 9 10\n2 4 6 8\n\nOutput:\n1 3 5 7 9 2 4 6 8\n\n\nExample 2:\nInput:\n1 2 3 4 5\n5 6 7 8\n\nOutput:\n1 2 3 4 5 6 7 8\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 112,
"prompt": "Write a function to count the total number of characters in a string.",
"code": "def count_charac(str1):\n total = 0\n for i in str1:\n total = total + 1\n return total",
"test_imports": [],
"test_list": [
"assert count_charac(\"python programming\")==18",
"assert count_charac(\"language\")==8",
"assert count_charac(\"words\")==5"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"python programming\n",
"language\n",
"words\n"
],
"test_output": [
"18\n",
"8\n",
"5\n"
],
"example_input": [
"python programming\n",
"language\n"
],
"example_output": [
"18\n",
"8\n"
],
"question": "Original problem description:\nWrite a function to count the total number of characters in a string.\nWe have its functional test sample:\nassert count_charac(\"python programming\")==18\nassert count_charac(\"language\")==8\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npython programming\n\nOutput:\n18\n\n\nExample 2:\nInput:\nlanguage\n\nOutput:\n8\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 113,
"prompt": "Write a python function to find the next perfect square greater than a given number.",
"code": "import math \ndef next_Perfect_Square(N): \n nextN = math.floor(math.sqrt(N)) + 1\n return nextN * nextN ",
"test_imports": [],
"test_list": [
"assert next_Perfect_Square(35) == 36",
"assert next_Perfect_Square(6) == 9",
"assert next_Perfect_Square(9) == 16"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"35\n",
"6\n",
"9\n"
],
"test_output": [
"36\n",
"9\n",
"16\n"
],
"example_input": [
"35\n",
"6\n"
],
"example_output": [
"36\n",
"9\n"
],
"question": "Original problem description:\nWrite a python function to find the next perfect square greater than a given number.\nWe have its functional test sample:\nassert next_Perfect_Square(35) == 36\nassert next_Perfect_Square(6) == 9\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n35\n\nOutput:\n36\n\n\nExample 2:\nInput:\n6\n\nOutput:\n9\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 114,
"prompt": "Write a function that takes an array and finds the maximum sum of a bitonic subsequence for the given array, where a sequence is bitonic if it is first increasing and then decreasing.",
"code": "def max_sum(arr): \n\tMSIBS = arr[:] \n\tfor i in range(len(arr)): \n\t\tfor j in range(0, i): \n\t\t\tif arr[i] > arr[j] and MSIBS[i] < MSIBS[j] + arr[i]: \n\t\t\t\tMSIBS[i] = MSIBS[j] + arr[i] \n\tMSDBS = arr[:] \n\tfor i in range(1, len(arr) + 1): \n\t\tfor j in range(1, i): \n\t\t\tif arr[-i] > arr[-j] and MSDBS[-i] < MSDBS[-j] + arr[-i]: \n\t\t\t\tMSDBS[-i] = MSDBS[-j] + arr[-i] \n\tmax_sum = float(\"-Inf\") \n\tfor i, j, k in zip(MSIBS, MSDBS, arr): \n\t\tmax_sum = max(max_sum, i + j - k) \n\treturn max_sum",
"test_imports": [],
"test_list": [
"assert max_sum([1, 15, 51, 45, 33, 100, 12, 18, 9]) == 194",
"assert max_sum([80, 60, 30, 40, 20, 10]) == 210",
"assert max_sum([2, 3 ,14, 16, 21, 23, 29, 30]) == 138"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 15 51 45 33 100 12 18 9\n",
"80 60 30 40 20 10\n",
"2 3 14 16 21 23 29 30\n"
],
"test_output": [
"194\n",
"210\n",
"138\n"
],
"example_input": [
"1 15 51 45 33 100 12 18 9\n",
"80 60 30 40 20 10\n"
],
"example_output": [
"194\n",
"210\n"
],
"question": "Original problem description:\nWrite a function that takes an array and finds the maximum sum of a bitonic subsequence for the given array, where a sequence is bitonic if it is first increasing and then decreasing.\nWe have its functional test sample:\nassert max_sum([1, 15, 51, 45, 33, 100, 12, 18, 9]) == 194\nassert max_sum([80, 60, 30, 40, 20, 10]) == 210\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 15 51 45 33 100 12 18 9\n\nOutput:\n194\n\n\nExample 2:\nInput:\n80 60 30 40 20 10\n\nOutput:\n210\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 116,
"prompt": "Write a function to find the length of the longest palindromic subsequence in the given string.",
"code": "def lps(str): \n\tn = len(str) \n\tL = [[0 for x in range(n)] for x in range(n)] \n\tfor i in range(n): \n\t\tL[i][i] = 1\n\tfor cl in range(2, n+1): \n\t\tfor i in range(n-cl+1): \n\t\t\tj = i+cl-1\n\t\t\tif str[i] == str[j] and cl == 2: \n\t\t\t\tL[i][j] = 2\n\t\t\telif str[i] == str[j]: \n\t\t\t\tL[i][j] = L[i+1][j-1] + 2\n\t\t\telse: \n\t\t\t\tL[i][j] = max(L[i][j-1], L[i+1][j]); \n\treturn L[0][n-1]",
"test_imports": [],
"test_list": [
"assert lps(\"TENS FOR TENS\") == 5",
"assert lps(\"CARDIO FOR CARDS\") == 7",
"assert lps(\"PART OF THE JOURNEY IS PART\") == 9"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"TENS FOR TENS\n",
"CARDIO FOR CARDS\n",
"PART OF THE JOURNEY IS PART\n"
],
"test_output": [
"5\n",
"7\n",
"9\n"
],
"example_input": [
"TENS FOR TENS\n",
"CARDIO FOR CARDS\n"
],
"example_output": [
"5\n",
"7\n"
],
"question": "Original problem description:\nWrite a function to find the length of the longest palindromic subsequence in the given string.\nWe have its functional test sample:\nassert lps(\"TENS FOR TENS\") == 5\nassert lps(\"CARDIO FOR CARDS\") == 7\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nTENS FOR TENS\n\nOutput:\n5\n\n\nExample 2:\nInput:\nCARDIO FOR CARDS\n\nOutput:\n7\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 118,
"prompt": "Write a function to find the intersection of two arrays.",
"code": "def intersection_array(array_nums1,array_nums2):\n result = list(filter(lambda x: x in array_nums1, array_nums2)) \n return result",
"test_imports": [],
"test_list": [
"assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[1, 2, 4, 8, 9])==[1, 2, 8, 9]",
"assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[3,5,7,9])==[3,5,7,9]",
"assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[10,20,30,40])==[10]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 5 7 8 9 10\n1 2 4 8 9\n",
"1 2 3 5 7 8 9 10\n3 5 7 9\n",
"1 2 3 5 7 8 9 10\n10 20 30 40\n"
],
"test_output": [
"1 2 8 9\n",
"3 5 7 9\n",
"10\n"
],
"example_input": [
"1 2 3 5 7 8 9 10\n1 2 4 8 9\n",
"1 2 3 5 7 8 9 10\n3 5 7 9\n"
],
"example_output": [
"1 2 8 9\n",
"3 5 7 9\n"
],
"question": "Original problem description:\nWrite a function to find the intersection of two arrays.\nWe have its functional test sample:\nassert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[1, 2, 4, 8, 9])==[1, 2, 8, 9]\nassert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[3,5,7,9])==[3,5,7,9]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 5 7 8 9 10\n1 2 4 8 9\n\nOutput:\n1 2 8 9\n\n\nExample 2:\nInput:\n1 2 3 5 7 8 9 10\n3 5 7 9\n\nOutput:\n3 5 7 9\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 119,
"prompt": "Write a python function that takes in a tuple and an element and counts the occcurences of the element in the tuple.",
"code": "def count_X(tup, x): \n count = 0\n for ele in tup: \n if (ele == x): \n count = count + 1\n return count ",
"test_imports": [],
"test_list": [
"assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),4) == 0",
"assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),10) == 3",
"assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),8) == 4"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 8 5 2 10 15 10 8 5 8 8 2\n4\n",
"10 8 5 2 10 15 10 8 5 8 8 2\n10\n",
"10 8 5 2 10 15 10 8 5 8 8 2\n8\n"
],
"test_output": [
"0\n",
"3\n",
"4\n"
],
"example_input": [
"10 8 5 2 10 15 10 8 5 8 8 2\n4\n",
"10 8 5 2 10 15 10 8 5 8 8 2\n10\n"
],
"example_output": [
"0\n",
"3\n"
],
"question": "Original problem description:\nWrite a python function that takes in a tuple and an element and counts the occcurences of the element in the tuple.\nWe have its functional test sample:\nassert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),4) == 0\nassert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),10) == 3\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 8 5 2 10 15 10 8 5 8 8 2\n4\n\nOutput:\n0\n\n\nExample 2:\nInput:\n10 8 5 2 10 15 10 8 5 8 8 2\n10\n\nOutput:\n3\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 120,
"prompt": "Write a function that takes in a list and an element and inserts the element before each element in the list, and returns the resulting list.",
"code": "def insert_element(list,element):\n list = [v for elt in list for v in (element, elt)]\n return list",
"test_imports": [],
"test_list": [
"assert insert_element(['Red', 'Green', 'Black'] ,'c')==['c', 'Red', 'c', 'Green', 'c', 'Black']",
"assert insert_element(['python', 'java'] ,'program')==['program', 'python', 'program', 'java']",
"assert insert_element(['happy', 'sad'] ,'laugh')==['laugh', 'happy', 'laugh', 'sad']"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Red Green Black\nc\n",
"python java\nprogram\n",
"happy sad\nlaugh\n"
],
"test_output": [
"c Red c Green c Black\n",
"program python program java\n",
"laugh happy laugh sad\n"
],
"example_input": [
"Red Green Black\nc\n",
"python java\nprogram\n"
],
"example_output": [
"c Red c Green c Black\n",
"program python program java\n"
],
"question": "Original problem description:\nWrite a function that takes in a list and an element and inserts the element before each element in the list, and returns the resulting list.\nWe have its functional test sample:\nassert insert_element(['Red', 'Green', 'Black'] ,'c')==['c', 'Red', 'c', 'Green', 'c', 'Black']\nassert insert_element(['python', 'java'] ,'program')==['program', 'python', 'program', 'java']\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nRed Green Black\nc\n\nOutput:\nc Red c Green c Black\n\n\nExample 2:\nInput:\npython java\nprogram\n\nOutput:\nprogram python program java\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 121,
"prompt": "Write a python function to convert complex numbers to polar coordinates.",
"code": "import cmath \ndef convert(numbers): \n num = cmath.polar(numbers) \n return (num) ",
"test_imports": [],
"test_list": [
"assert convert(1) == (1.0, 0.0)",
"assert convert(4) == (4.0,0.0)",
"assert convert(5) == (5.0,0.0)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n",
"4\n",
"5\n"
],
"test_output": [
"1.0 0.0\n",
"4.0 0.0\n",
"5.0 0.0\n"
],
"example_input": [
"1\n",
"4\n"
],
"example_output": [
"1.0 0.0\n",
"4.0 0.0\n"
],
"question": "Original problem description:\nWrite a python function to convert complex numbers to polar coordinates.\nWe have its functional test sample:\nassert convert(1) == (1.0, 0.0)\nassert convert(4) == (4.0,0.0)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n\nOutput:\n1.0 0.0\n\n\nExample 2:\nInput:\n4\n\nOutput:\n4.0 0.0\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 122,
"prompt": "Write a python function that returns the number of integer elements in a given list.",
"code": "def count_integer(list1):\n ctr = 0\n for i in list1:\n if isinstance(i, int):\n ctr = ctr + 1\n return ctr",
"test_imports": [],
"test_list": [
"assert count_integer([1,2,'abc',1.2]) == 2",
"assert count_integer([1,2,3]) == 3",
"assert count_integer([1,1.2,4,5.1]) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 abc 1.2\n",
"1 2 3\n",
"1 1.2 4 5.1\n"
],
"test_output": [
"2\n",
"3\n",
"2\n"
],
"example_input": [
"1 2 abc 1.2\n",
"1 2 3\n"
],
"example_output": [
"2\n",
"3\n"
],
"question": "Original problem description:\nWrite a python function that returns the number of integer elements in a given list.\nWe have its functional test sample:\nassert count_integer([1,2,'abc',1.2]) == 2\nassert count_integer([1,2,3]) == 3\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 abc 1.2\n\nOutput:\n2\n\n\nExample 2:\nInput:\n1 2 3\n\nOutput:\n3\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 123,
"prompt": "Write a function that takes in a list and length n, and generates all combinations (with repetition) of the elements of the list and returns a list with a tuple for each combination.",
"code": "from itertools import combinations_with_replacement \ndef combinations_colors(l, n):\n return list(combinations_with_replacement(l,n))\n",
"test_imports": [],
"test_list": [
"assert combinations_colors( [\"Red\",\"Green\",\"Blue\"],1)==[('Red',), ('Green',), ('Blue',)]",
"assert combinations_colors( [\"Red\",\"Green\",\"Blue\"],2)==[('Red', 'Red'), ('Red', 'Green'), ('Red', 'Blue'), ('Green', 'Green'), ('Green', 'Blue'), ('Blue', 'Blue')]",
"assert combinations_colors( [\"Red\",\"Green\",\"Blue\"],3)==[('Red', 'Red', 'Red'), ('Red', 'Red', 'Green'), ('Red', 'Red', 'Blue'), ('Red', 'Green', 'Green'), ('Red', 'Green', 'Blue'), ('Red', 'Blue', 'Blue'), ('Green', 'Green', 'Green'), ('Green', 'Green', 'Blue'), ('Green', 'Blue', 'Blue'), ('Blue', 'Blue', 'Blue')]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Red Green Blue\n1\n",
"Red Green Blue\n2\n",
"Red Green Blue\n3\n"
],
"test_output": [
"Red\nGreen\nBlue\n",
"Red Red\nRed Green\nRed Blue\nGreen Green\nGreen Blue\nBlue Blue\n",
"Red Red Red\nRed Red Green\nRed Red Blue\nRed Green Green\nRed Green Blue\nRed Blue Blue\nGreen Green Green\nGreen Green Blue\nGreen Blue Blue\nBlue Blue Blue\n"
],
"example_input": [
"Red Green Blue\n1\n",
"Red Green Blue\n2\n"
],
"example_output": [
"Red\nGreen\nBlue\n",
"Red Red\nRed Green\nRed Blue\nGreen Green\nGreen Blue\nBlue Blue\n"
],
"question": "Original problem description:\nWrite a function that takes in a list and length n, and generates all combinations (with repetition) of the elements of the list and returns a list with a tuple for each combination.\nWe have its functional test sample:\nassert combinations_colors( [\"Red\",\"Green\",\"Blue\"],1)==[('Red',), ('Green',), ('Blue',)]\nassert combinations_colors( [\"Red\",\"Green\",\"Blue\"],2)==[('Red', 'Red'), ('Red', 'Green'), ('Red', 'Blue'), ('Green', 'Green'), ('Green', 'Blue'), ('Blue', 'Blue')]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nRed Green Blue\n1\n\nOutput:\nRed\nGreen\nBlue\n\n\nExample 2:\nInput:\nRed Green Blue\n2\n\nOutput:\nRed Red\nRed Green\nRed Blue\nGreen Green\nGreen Blue\nBlue Blue\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 124,
"prompt": "Write a python function that takes in a non-negative number and returns the number of prime numbers less than the given non-negative number.",
"code": "def count_Primes_nums(n):\n ctr = 0\n for num in range(n):\n if num <= 1:\n continue\n for i in range(2,num):\n if (num % i) == 0:\n break\n else:\n ctr += 1\n return ctr",
"test_imports": [],
"test_list": [
"assert count_Primes_nums(5) == 2",
"assert count_Primes_nums(10) == 4",
"assert count_Primes_nums(100) == 25"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n",
"10\n",
"100\n"
],
"test_output": [
"2\n",
"4\n",
"25\n"
],
"example_input": [
"5\n",
"10\n"
],
"example_output": [
"2\n",
"4\n"
],
"question": "Original problem description:\nWrite a python function that takes in a non-negative number and returns the number of prime numbers less than the given non-negative number.\nWe have its functional test sample:\nassert count_Primes_nums(5) == 2\nassert count_Primes_nums(10) == 4\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n\nOutput:\n2\n\n\nExample 2:\nInput:\n10\n\nOutput:\n4\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 125,
"prompt": "Write a function that takes in two numbers and returns a tuple with the second number and then the first number.",
"code": "def swap_numbers(a,b):\n temp = a\n a = b\n b = temp\n return (a,b)",
"test_imports": [],
"test_list": [
"assert swap_numbers(10,20)==(20,10)",
"assert swap_numbers(15,17)==(17,15)",
"assert swap_numbers(100,200)==(200,100)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n20\n",
"15\n17\n",
"100\n200\n"
],
"test_output": [
"20 10\n",
"17 15\n",
"200 100\n"
],
"example_input": [
"10\n20\n",
"15\n17\n"
],
"example_output": [
"20 10\n",
"17 15\n"
],
"question": "Original problem description:\nWrite a function that takes in two numbers and returns a tuple with the second number and then the first number.\nWe have its functional test sample:\nassert swap_numbers(10,20)==(20,10)\nassert swap_numbers(15,17)==(17,15)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n20\n\nOutput:\n20 10\n\n\nExample 2:\nInput:\n15\n17\n\nOutput:\n17 15\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 127,
"prompt": "Write a function to find the nth newman–shanks–williams prime number.",
"code": "def newman_prime(n): \n\tif n == 0 or n == 1: \n\t\treturn 1\n\treturn 2 * newman_prime(n - 1) + newman_prime(n - 2)",
"test_imports": [],
"test_list": [
"assert newman_prime(3) == 7",
"assert newman_prime(4) == 17",
"assert newman_prime(5) == 41"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3\n",
"4\n",
"5\n"
],
"test_output": [
"7\n",
"17\n",
"41\n"
],
"example_input": [
"3\n",
"4\n"
],
"example_output": [
"7\n",
"17\n"
],
"question": "Original problem description:\nWrite a function to find the nth newman–shanks–williams prime number.\nWe have its functional test sample:\nassert newman_prime(3) == 7\nassert newman_prime(4) == 17\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3\n\nOutput:\n7\n\n\nExample 2:\nInput:\n4\n\nOutput:\n17\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 128,
"prompt": "Write a function that takes in two tuples and performs mathematical division operation element-wise across the given tuples.",
"code": "def division_elements(test_tup1, test_tup2):\n res = tuple(ele1 // ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\n return (res) ",
"test_imports": [],
"test_list": [
"assert division_elements((10, 4, 6, 9),(5, 2, 3, 3)) == (2, 2, 2, 3)",
"assert division_elements((12, 6, 8, 16),(6, 3, 4, 4)) == (2, 2, 2, 4)",
"assert division_elements((20, 14, 36, 18),(5, 7, 6, 9)) == (4, 2, 6, 2)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 4 6 9\n5 2 3 3\n",
"12 6 8 16\n6 3 4 4\n",
"20 14 36 18\n5 7 6 9\n"
],
"test_output": [
"2 2 2 3\n",
"2 2 2 4\n",
"4 2 6 2\n"
],
"example_input": [
"10 4 6 9\n5 2 3 3\n",
"12 6 8 16\n6 3 4 4\n"
],
"example_output": [
"2 2 2 3\n",
"2 2 2 4\n"
],
"question": "Original problem description:\nWrite a function that takes in two tuples and performs mathematical division operation element-wise across the given tuples.\nWe have its functional test sample:\nassert division_elements((10, 4, 6, 9),(5, 2, 3, 3)) == (2, 2, 2, 3)\nassert division_elements((12, 6, 8, 16),(6, 3, 4, 4)) == (2, 2, 2, 4)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 4 6 9\n5 2 3 3\n\nOutput:\n2 2 2 3\n\n\nExample 2:\nInput:\n12 6 8 16\n6 3 4 4\n\nOutput:\n2 2 2 4\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 130,
"prompt": "Write a function to calculate a dog's age in dog's years.",
"code": "def dog_age(h_age):\n if h_age < 0:\n \texit()\n elif h_age <= 2:\n\t d_age = h_age * 10.5\n else:\n\t d_age = 21 + (h_age - 2)*4\n return d_age",
"test_imports": [],
"test_list": [
"assert dog_age(12)==61",
"assert dog_age(15)==73",
"assert dog_age(24)==109"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"12\n",
"15\n",
"24\n"
],
"test_output": [
"61\n",
"73\n",
"109\n"
],
"example_input": [
"12\n",
"15\n"
],
"example_output": [
"61\n",
"73\n"
],
"question": "Original problem description:\nWrite a function to calculate a dog's age in dog's years.\nWe have its functional test sample:\nassert dog_age(12)==61\nassert dog_age(15)==73\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n12\n\nOutput:\n61\n\n\nExample 2:\nInput:\n15\n\nOutput:\n73\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 131,
"prompt": "Write a function that takes in a list and an integer n and splits a list for every nth element, returning a list of the resulting lists.",
"code": "def list_split(S, step):\n return [S[i::step] for i in range(step)]",
"test_imports": [],
"test_list": [
"assert list_split(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'],3)==[['a', 'd', 'g', 'j', 'm'], ['b', 'e', 'h', 'k', 'n'], ['c', 'f', 'i', 'l']]",
"assert list_split([1,2,3,4,5,6,7,8,9,10,11,12,13,14],3)==[[1,4,7,10,13], [2,5,8,11,14], [3,6,9,12]]",
"assert list_split(['python','java','C','C++','DBMS','SQL'],2)==[['python', 'C', 'DBMS'], ['java', 'C++', 'SQL']]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"a b c d e f g h i j k l m n\n3\n",
"1 2 3 4 5 6 7 8 9 10 11 12 13 14\n3\n",
"python java C C++ DBMS SQL\n2\n"
],
"test_output": [
"a d g j m\nb e h k n\nc f i l\n",
"1 4 7 10 13\n2 5 8 11 14\n3 6 9 12\n",
"python C DBMS\njava C++ SQL\n"
],
"example_input": [
"a b c d e f g h i j k l m n\n3\n",
"1 2 3 4 5 6 7 8 9 10 11 12 13 14\n3\n"
],
"example_output": [
"a d g j m\nb e h k n\nc f i l\n",
"1 4 7 10 13\n2 5 8 11 14\n3 6 9 12\n"
],
"question": "Original problem description:\nWrite a function that takes in a list and an integer n and splits a list for every nth element, returning a list of the resulting lists.\nWe have its functional test sample:\nassert list_split(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'],3)==[['a', 'd', 'g', 'j', 'm'], ['b', 'e', 'h', 'k', 'n'], ['c', 'f', 'i', 'l']]\nassert list_split([1,2,3,4,5,6,7,8,9,10,11,12,13,14],3)==[[1,4,7,10,13], [2,5,8,11,14], [3,6,9,12]]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\na b c d e f g h i j k l m n\n3\n\nOutput:\na d g j m\nb e h k n\nc f i l\n\n\nExample 2:\nInput:\n1 2 3 4 5 6 7 8 9 10 11 12 13 14\n3\n\nOutput:\n1 4 7 10 13\n2 5 8 11 14\n3 6 9 12\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 132,
"prompt": "Write a function to find the lateral surface area of a cube given its side length.",
"code": "def lateralsurface_cube(l):\n LSA = 4 * (l * l)\n return LSA",
"test_imports": [],
"test_list": [
"assert lateralsurface_cube(5)==100",
"assert lateralsurface_cube(9)==324",
"assert lateralsurface_cube(10)==400"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n",
"9\n",
"10\n"
],
"test_output": [
"100\n",
"324\n",
"400\n"
],
"example_input": [
"5\n",
"9\n"
],
"example_output": [
"100\n",
"324\n"
],
"question": "Original problem description:\nWrite a function to find the lateral surface area of a cube given its side length.\nWe have its functional test sample:\nassert lateralsurface_cube(5)==100\nassert lateralsurface_cube(9)==324\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n\nOutput:\n100\n\n\nExample 2:\nInput:\n9\n\nOutput:\n324\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 133,
"prompt": "Write a python function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers.",
"code": "def square_Sum(n): \n return int(n*(4*n*n-1)/3) ",
"test_imports": [],
"test_list": [
"assert square_Sum(2) == 10",
"assert square_Sum(3) == 35",
"assert square_Sum(4) == 84"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n",
"3\n",
"4\n"
],
"test_output": [
"10\n",
"35\n",
"84\n"
],
"example_input": [
"2\n",
"3\n"
],
"example_output": [
"10\n",
"35\n"
],
"question": "Original problem description:\nWrite a python function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers.\nWe have its functional test sample:\nassert square_Sum(2) == 10\nassert square_Sum(3) == 35\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n\nOutput:\n10\n\n\nExample 2:\nInput:\n3\n\nOutput:\n35\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 134,
"prompt": "Write a function to find the n'th star number.",
"code": "def find_star_num(n): \n\treturn (6 * n * (n - 1) + 1) ",
"test_imports": [],
"test_list": [
"assert find_star_num(3) == 37",
"assert find_star_num(4) == 73",
"assert find_star_num(5) == 121"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3\n",
"4\n",
"5\n"
],
"test_output": [
"37\n",
"73\n",
"121\n"
],
"example_input": [
"3\n",
"4\n"
],
"example_output": [
"37\n",
"73\n"
],
"question": "Original problem description:\nWrite a function to find the n'th star number.\nWe have its functional test sample:\nassert find_star_num(3) == 37\nassert find_star_num(4) == 73\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3\n\nOutput:\n37\n\n\nExample 2:\nInput:\n4\n\nOutput:\n73\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 135,
"prompt": "Write a function to find the ascii value of a character.",
"code": "def ascii_value(k):\n ch=k\n return ord(ch)",
"test_imports": [],
"test_list": [
"assert ascii_value('A')==65",
"assert ascii_value('R')==82",
"assert ascii_value('S')==83"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"A\n",
"R\n",
"S\n"
],
"test_output": [
"65\n",
"82\n",
"83\n"
],
"example_input": [
"A\n",
"R\n"
],
"example_output": [
"65\n",
"82\n"
],
"question": "Original problem description:\nWrite a function to find the ascii value of a character.\nWe have its functional test sample:\nassert ascii_value('A')==65\nassert ascii_value('R')==82\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nA\n\nOutput:\n65\n\n\nExample 2:\nInput:\nR\n\nOutput:\n82\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 136,
"prompt": "Write a python function to find the sum of even numbers at even positions of a list.",
"code": "def sum_even_and_even_index(arr): \n i = 0\n sum = 0\n for i in range(0, len(arr),2): \n if (arr[i] % 2 == 0) : \n sum += arr[i] \n return sum",
"test_imports": [],
"test_list": [
"assert sum_even_and_even_index([5, 6, 12, 1, 18, 8]) == 30",
"assert sum_even_and_even_index([3, 20, 17, 9, 2, 10, 18, 13, 6, 18]) == 26",
"assert sum_even_and_even_index([5, 6, 12, 1]) == 12"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5 6 12 1 18 8\n",
"3 20 17 9 2 10 18 13 6 18\n",
"5 6 12 1\n"
],
"test_output": [
"30\n",
"26\n",
"12\n"
],
"example_input": [
"5 6 12 1 18 8\n",
"3 20 17 9 2 10 18 13 6 18\n"
],
"example_output": [
"30\n",
"26\n"
],
"question": "Original problem description:\nWrite a python function to find the sum of even numbers at even positions of a list.\nWe have its functional test sample:\nassert sum_even_and_even_index([5, 6, 12, 1, 18, 8]) == 30\nassert sum_even_and_even_index([3, 20, 17, 9, 2, 10, 18, 13, 6, 18]) == 26\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5 6 12 1 18 8\n\nOutput:\n30\n\n\nExample 2:\nInput:\n3 20 17 9 2 10 18 13 6 18\n\nOutput:\n26\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 137,
"prompt": "Write a python function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth power.",
"code": "def even_Power_Sum(n): \n sum = 0; \n for i in range(1,n+1): \n j = 2*i; \n sum = sum + (j*j*j*j*j); \n return sum; ",
"test_imports": [],
"test_list": [
"assert even_Power_Sum(2) == 1056",
"assert even_Power_Sum(3) == 8832",
"assert even_Power_Sum(1) == 32"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n",
"3\n",
"1\n"
],
"test_output": [
"1056\n",
"8832\n",
"32\n"
],
"example_input": [
"2\n",
"3\n"
],
"example_output": [
"1056\n",
"8832\n"
],
"question": "Original problem description:\nWrite a python function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth power.\nWe have its functional test sample:\nassert even_Power_Sum(2) == 1056\nassert even_Power_Sum(3) == 8832\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n\nOutput:\n1056\n\n\nExample 2:\nInput:\n3\n\nOutput:\n8832\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 138,
"prompt": "Write a function that takes in a list of tuples and returns a list containing the rear element of each tuple.",
"code": "def rear_extract(test_list):\n res = [lis[-1] for lis in test_list]\n return (res) ",
"test_imports": [],
"test_list": [
"assert rear_extract([(1, 'Rash', 21), (2, 'Varsha', 20), (3, 'Kil', 19)]) == [21, 20, 19]",
"assert rear_extract([(1, 'Sai', 36), (2, 'Ayesha', 25), (3, 'Salman', 45)]) == [36, 25, 45]",
"assert rear_extract([(1, 'Sudeep', 14), (2, 'Vandana', 36), (3, 'Dawood', 56)]) == [14, 36, 56]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 Rash 21\n2 Varsha 20\n3 Kil 19\n",
"1 Sai 36\n2 Ayesha 25\n3 Salman 45\n",
"1 Sudeep 14\n2 Vandana 36\n3 Dawood 56\n"
],
"test_output": [
"21 20 19\n",
"36 25 45\n",
"14 36 56\n"
],
"example_input": [
"1 Rash 21\n2 Varsha 20\n3 Kil 19\n",
"1 Sai 36\n2 Ayesha 25\n3 Salman 45\n"
],
"example_output": [
"21 20 19\n",
"36 25 45\n"
],
"question": "Original problem description:\nWrite a function that takes in a list of tuples and returns a list containing the rear element of each tuple.\nWe have its functional test sample:\nassert rear_extract([(1, 'Rash', 21), (2, 'Varsha', 20), (3, 'Kil', 19)]) == [21, 20, 19]\nassert rear_extract([(1, 'Sai', 36), (2, 'Ayesha', 25), (3, 'Salman', 45)]) == [36, 25, 45]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 Rash 21\n2 Varsha 20\n3 Kil 19\n\nOutput:\n21 20 19\n\n\nExample 2:\nInput:\n1 Sai 36\n2 Ayesha 25\n3 Salman 45\n\nOutput:\n36 25 45\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 139,
"prompt": "Write a function that takes in two tuples and subtracts the elements of the first tuple by the elements of the second tuple with the same index.",
"code": "def substract_elements(test_tup1, test_tup2):\n res = tuple(map(lambda i, j: i - j, test_tup1, test_tup2))\n return (res) ",
"test_imports": [],
"test_list": [
"assert substract_elements((10, 4, 5), (2, 5, 18)) == (8, -1, -13)",
"assert substract_elements((11, 2, 3), (24, 45 ,16)) == (-13, -43, -13)",
"assert substract_elements((7, 18, 9), (10, 11, 12)) == (-3, 7, -3)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 4 5\n2 5 18\n",
"11 2 3\n24 45 16\n",
"7 18 9\n10 11 12\n"
],
"test_output": [
"8 -1 -13\n",
"-13 -43 -13\n",
"-3 7 -3\n"
],
"example_input": [
"10 4 5\n2 5 18\n",
"11 2 3\n24 45 16\n"
],
"example_output": [
"8 -1 -13\n",
"-13 -43 -13\n"
],
"question": "Original problem description:\nWrite a function that takes in two tuples and subtracts the elements of the first tuple by the elements of the second tuple with the same index.\nWe have its functional test sample:\nassert substract_elements((10, 4, 5), (2, 5, 18)) == (8, -1, -13)\nassert substract_elements((11, 2, 3), (24, 45 ,16)) == (-13, -43, -13)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 4 5\n2 5 18\n\nOutput:\n8 -1 -13\n\n\nExample 2:\nInput:\n11 2 3\n24 45 16\n\nOutput:\n-13 -43 -13\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 140,
"prompt": "Write a python function that takes in a positive integer n and finds the sum of even index binomial coefficients.",
"code": "import math \ndef even_binomial_Coeff_Sum( n): \n return (1 << (n - 1)) ",
"test_imports": [],
"test_list": [
"assert even_binomial_Coeff_Sum(4) == 8",
"assert even_binomial_Coeff_Sum(6) == 32",
"assert even_binomial_Coeff_Sum(2) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"4\n",
"6\n",
"2\n"
],
"test_output": [
"8\n",
"32\n",
"2\n"
],
"example_input": [
"4\n",
"6\n"
],
"example_output": [
"8\n",
"32\n"
],
"question": "Original problem description:\nWrite a python function that takes in a positive integer n and finds the sum of even index binomial coefficients.\nWe have its functional test sample:\nassert even_binomial_Coeff_Sum(4) == 8\nassert even_binomial_Coeff_Sum(6) == 32\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n4\n\nOutput:\n8\n\n\nExample 2:\nInput:\n6\n\nOutput:\n32\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 142,
"prompt": "Write a function that takes in a dictionary and integer n and filters the dictionary to only include entries with values greater than or equal to n.",
"code": "def dict_filter(dict,n):\n result = {key:value for (key, value) in dict.items() if value >=n}\n return result",
"test_imports": [],
"test_list": [
"assert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},170)=={'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190}",
"assert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},180)=={ 'Alden Cantrell': 180, 'Pierre Cox': 190}",
"assert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},190)=={ 'Pierre Cox': 190}"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190}\n170\n",
"{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190}\n180\n",
"{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190}\n190\n"
],
"test_output": [
"{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190}\n",
"{'Alden Cantrell': 180, 'Pierre Cox': 190}\n",
"{'Pierre Cox': 190}\n"
],
"example_input": [
"{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190}\n170\n",
"{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190}\n180\n"
],
"example_output": [
"{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190}\n",
"{'Alden Cantrell': 180, 'Pierre Cox': 190}\n"
],
"question": "Original problem description:\nWrite a function that takes in a dictionary and integer n and filters the dictionary to only include entries with values greater than or equal to n.\nWe have its functional test sample:\nassert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},170)=={'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190}\nassert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},180)=={ 'Alden Cantrell': 180, 'Pierre Cox': 190}\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190}\n170\n\nOutput:\n{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190}\n\n\nExample 2:\nInput:\n{'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190}\n180\n\nOutput:\n{'Alden Cantrell': 180, 'Pierre Cox': 190}\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 143,
"prompt": "Write a function to find the number of elements that occurs before the tuple element in the given tuple.",
"code": "def count_first_elements(test_tup):\n for count, ele in enumerate(test_tup):\n if isinstance(ele, tuple):\n break\n return (count) ",
"test_imports": [],
"test_list": [
"assert count_first_elements((1, 5, 7, (4, 6), 10) ) == 3",
"assert count_first_elements((2, 9, (5, 7), 11) ) == 2",
"assert count_first_elements((11, 15, 5, 8, (2, 3), 8) ) == 4"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n5\n7\n4 6\n10\n",
"2\n9\n5 7\n11\n",
"11\n15\n5\n8\n2 3\n8\n"
],
"test_output": [
"3\n",
"2\n",
"4\n"
],
"example_input": [
"1\n5\n7\n4 6\n10\n",
"2\n9\n5 7\n11\n"
],
"example_output": [
"3\n",
"2\n"
],
"question": "Original problem description:\nWrite a function to find the number of elements that occurs before the tuple element in the given tuple.\nWe have its functional test sample:\nassert count_first_elements((1, 5, 7, (4, 6), 10) ) == 3\nassert count_first_elements((2, 9, (5, 7), 11) ) == 2\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n5\n7\n4 6\n10\n\nOutput:\n3\n\n\nExample 2:\nInput:\n2\n9\n5 7\n11\n\nOutput:\n2\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 144,
"prompt": "Write a function to find the nth decagonal number.",
"code": "def is_num_decagonal(n): \n\treturn 4 * n * n - 3 * n ",
"test_imports": [],
"test_list": [
"assert is_num_decagonal(3) == 27",
"assert is_num_decagonal(7) == 175",
"assert is_num_decagonal(10) == 370"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3\n",
"7\n",
"10\n"
],
"test_output": [
"27\n",
"175\n",
"370\n"
],
"example_input": [
"3\n",
"7\n"
],
"example_output": [
"27\n",
"175\n"
],
"question": "Original problem description:\nWrite a function to find the nth decagonal number.\nWe have its functional test sample:\nassert is_num_decagonal(3) == 27\nassert is_num_decagonal(7) == 175\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3\n\nOutput:\n27\n\n\nExample 2:\nInput:\n7\n\nOutput:\n175\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 145,
"prompt": "Write a function that takes in an array and element and returns a tuple containing a boolean that indicates if the element is in the array and the index position of the element (or -1 if the element is not found).",
"code": "def sequential_search(dlist, item):\n pos = 0\n found = False\n while pos < len(dlist) and not found:\n if dlist[pos] == item:\n found = True\n else:\n pos = pos + 1\n return found, pos",
"test_imports": [],
"test_list": [
"assert sequential_search([11,23,58,31,56,77,43,12,65,19],31) == (True, 3)",
"assert sequential_search([12, 32, 45, 62, 35, 47, 44, 61],61) == (True, 7)",
"assert sequential_search([9, 10, 17, 19, 22, 39, 48, 56],48) == (True, 6)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"11 23 58 31 56 77 43 12 65 19\n31\n",
"12 32 45 62 35 47 44 61\n61\n",
"9 10 17 19 22 39 48 56\n48\n"
],
"test_output": [
"True 3\n",
"True 7\n",
"True 6\n"
],
"example_input": [
"11 23 58 31 56 77 43 12 65 19\n31\n",
"12 32 45 62 35 47 44 61\n61\n"
],
"example_output": [
"True 3\n",
"True 7\n"
],
"question": "Original problem description:\nWrite a function that takes in an array and element and returns a tuple containing a boolean that indicates if the element is in the array and the index position of the element (or -1 if the element is not found).\nWe have its functional test sample:\nassert sequential_search([11,23,58,31,56,77,43,12,65,19],31) == (True, 3)\nassert sequential_search([12, 32, 45, 62, 35, 47, 44, 61],61) == (True, 7)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n11 23 58 31 56 77 43 12 65 19\n31\n\nOutput:\nTrue 3\n\n\nExample 2:\nInput:\n12 32 45 62 35 47 44 61\n61\n\nOutput:\nTrue 7\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 146,
"prompt": "Write a python function to check if the elements of a given list are unique or not.",
"code": "def all_unique(test_list):\n if len(test_list) > len(set(test_list)):\n return False\n return True",
"test_imports": [],
"test_list": [
"assert all_unique([1,2,3]) == True",
"assert all_unique([1,2,1,2]) == False",
"assert all_unique([1,2,3,4,5]) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3\n",
"1 2 1 2\n",
"1 2 3 4 5\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"1 2 3\n",
"1 2 1 2\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a python function to check if the elements of a given list are unique or not.\nWe have its functional test sample:\nassert all_unique([1,2,3]) == True\nassert all_unique([1,2,1,2]) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n1 2 1 2\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 147,
"prompt": "Write a function to subtract two lists element-wise.",
"code": "def sub_list(nums1,nums2):\n result = map(lambda x, y: x - y, nums1, nums2)\n return list(result)",
"test_imports": [],
"test_list": [
"assert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3]",
"assert sub_list([1,2],[3,4])==[-2,-2]",
"assert sub_list([90,120],[50,70])==[40,50]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3\n4 5 6\n",
"1 2\n3 4\n",
"90 120\n50 70\n"
],
"test_output": [
"-3 -3 -3\n",
"-2 -2\n",
"40 50\n"
],
"example_input": [
"1 2 3\n4 5 6\n",
"1 2\n3 4\n"
],
"example_output": [
"-3 -3 -3\n",
"-2 -2\n"
],
"question": "Original problem description:\nWrite a function to subtract two lists element-wise.\nWe have its functional test sample:\nassert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3]\nassert sub_list([1,2],[3,4])==[-2,-2]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3\n4 5 6\n\nOutput:\n-3 -3 -3\n\n\nExample 2:\nInput:\n1 2\n3 4\n\nOutput:\n-2 -2\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 148,
"prompt": "Write a python function takes in an integer and check whether the frequency of each digit in the integer is less than or equal to the digit itself.",
"code": "def validate(n): \n for i in range(10): \n temp = n; \n count = 0; \n while (temp): \n if (temp % 10 == i): \n count+=1; \n if (count > i): \n return False\n temp //= 10; \n return True",
"test_imports": [],
"test_list": [
"assert validate(1234) == True",
"assert validate(51241) == False",
"assert validate(321) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1234\n",
"51241\n",
"321\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"1234\n",
"51241\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a python function takes in an integer and check whether the frequency of each digit in the integer is less than or equal to the digit itself.\nWe have its functional test sample:\nassert validate(1234) == True\nassert validate(51241) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1234\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n51241\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 149,
"prompt": "Write a function that takes in a list and element and checks whether all items in the list are equal to the given element.",
"code": "def check_element(list,element):\n check_element=all(v== element for v in list)\n return check_element",
"test_imports": [],
"test_list": [
"assert check_element([\"green\", \"orange\", \"black\", \"white\"],'blue')==False",
"assert check_element([1,2,3,4],7)==False",
"assert check_element([\"green\", \"green\", \"green\", \"green\"],'green')==True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"green orange black white\nblue\n",
"1 2 3 4\n7\n",
"green green green green\ngreen\n"
],
"test_output": [
"False\n",
"False\n",
"True\n"
],
"example_input": [
"green orange black white\nblue\n",
"1 2 3 4\n7\n"
],
"example_output": [
"False\n",
"False\n"
],
"question": "Original problem description:\nWrite a function that takes in a list and element and checks whether all items in the list are equal to the given element.\nWe have its functional test sample:\nassert check_element([\"green\", \"orange\", \"black\", \"white\"],'blue')==False\nassert check_element([1,2,3,4],7)==False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\ngreen orange black white\nblue\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n1 2 3 4\n7\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 150,
"prompt": "Write a function that checks whether a string contains the 'a' character followed by two or three 'b' characters.",
"code": "import re\ndef text_match_two_three(text):\n patterns = 'ab{2,3}'\n if re.search(patterns, text):\n return True\n else:\n return False",
"test_imports": [],
"test_list": [
"assert text_match_two_three(\"ac\")==(False)",
"assert text_match_two_three(\"dc\")==(False)",
"assert text_match_two_three(\"abbbba\")==(True)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"ac\n",
"dc\n",
"abbbba\n"
],
"test_output": [
"False\n",
"False\n",
"True\n"
],
"example_input": [
"ac\n",
"dc\n"
],
"example_output": [
"False\n",
"False\n"
],
"question": "Original problem description:\nWrite a function that checks whether a string contains the 'a' character followed by two or three 'b' characters.\nWe have its functional test sample:\nassert text_match_two_three(\"ac\")==(False)\nassert text_match_two_three(\"dc\")==(False)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nac\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\ndc\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 151,
"prompt": "Write a function to find the largest sum of a contiguous array in the modified array which is formed by repeating the given array k times.",
"code": "def max_sub_array_sum_repeated(a, n, k): \n\tmax_so_far = -2147483648\n\tmax_ending_here = 0\n\tfor i in range(n*k): \n\t\tmax_ending_here = max_ending_here + a[i%n] \n\t\tif (max_so_far < max_ending_here): \n\t\t\tmax_so_far = max_ending_here \n\t\tif (max_ending_here < 0): \n\t\t\tmax_ending_here = 0\n\treturn max_so_far",
"test_imports": [],
"test_list": [
"assert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30",
"assert max_sub_array_sum_repeated([-1, 10, 20], 3, 2) == 59",
"assert max_sub_array_sum_repeated([-1, -2, -3], 3, 3) == -1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 20 -30 -1\n4\n3\n",
"-1 10 20\n3\n2\n",
"-1 -2 -3\n3\n3\n"
],
"test_output": [
"30\n",
"59\n",
"-1\n"
],
"example_input": [
"10 20 -30 -1\n4\n3\n",
"-1 10 20\n3\n2\n"
],
"example_output": [
"30\n",
"59\n"
],
"question": "Original problem description:\nWrite a function to find the largest sum of a contiguous array in the modified array which is formed by repeating the given array k times.\nWe have its functional test sample:\nassert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30\nassert max_sub_array_sum_repeated([-1, 10, 20], 3, 2) == 59\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 20 -30 -1\n4\n3\n\nOutput:\n30\n\n\nExample 2:\nInput:\n-1 10 20\n3\n2\n\nOutput:\n59\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 152,
"prompt": "Write a python function takes in an integer n and returns the sum of squares of first n even natural numbers.",
"code": "def square_Sum(n): \n return int(2*n*(n+1)*(2*n+1)/3)",
"test_imports": [],
"test_list": [
"assert square_Sum(2) == 20",
"assert square_Sum(3) == 56",
"assert square_Sum(4) == 120"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n",
"3\n",
"4\n"
],
"test_output": [
"20\n",
"56\n",
"120\n"
],
"example_input": [
"2\n",
"3\n"
],
"example_output": [
"20\n",
"56\n"
],
"question": "Original problem description:\nWrite a python function takes in an integer n and returns the sum of squares of first n even natural numbers.\nWe have its functional test sample:\nassert square_Sum(2) == 20\nassert square_Sum(3) == 56\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n\nOutput:\n20\n\n\nExample 2:\nInput:\n3\n\nOutput:\n56\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 154,
"prompt": "Write a function to find out the number of ways of painting the fence such that at most 2 adjacent posts have the same color for the given fence with n posts and k colors.",
"code": "def count_no_of_ways(n, k): \n\tdp = [0] * (n + 1) \n\ttotal = k \n\tmod = 1000000007\n\tdp[1] = k \n\tdp[2] = k * k\t \n\tfor i in range(3,n+1): \n\t\tdp[i] = ((k - 1) * (dp[i - 1] + dp[i - 2])) % mod \n\treturn dp[n]",
"test_imports": [],
"test_list": [
"assert count_no_of_ways(2, 4) == 16",
"assert count_no_of_ways(3, 2) == 6",
"assert count_no_of_ways(4, 4) == 228"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n4\n",
"3\n2\n",
"4\n4\n"
],
"test_output": [
"16\n",
"6\n",
"228\n"
],
"example_input": [
"2\n4\n",
"3\n2\n"
],
"example_output": [
"16\n",
"6\n"
],
"question": "Original problem description:\nWrite a function to find out the number of ways of painting the fence such that at most 2 adjacent posts have the same color for the given fence with n posts and k colors.\nWe have its functional test sample:\nassert count_no_of_ways(2, 4) == 16\nassert count_no_of_ways(3, 2) == 6\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n4\n\nOutput:\n16\n\n\nExample 2:\nInput:\n3\n2\n\nOutput:\n6\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 155,
"prompt": "Write a python function to find quotient of two numbers (rounded down to the nearest integer).",
"code": "def find(n,m): \n q = n//m \n return (q)",
"test_imports": [],
"test_list": [
"assert find(10,3) == 3",
"assert find(4,2) == 2",
"assert find(20,5) == 4"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n3\n",
"4\n2\n",
"20\n5\n"
],
"test_output": [
"3\n",
"2\n",
"4\n"
],
"example_input": [
"10\n3\n",
"4\n2\n"
],
"example_output": [
"3\n",
"2\n"
],
"question": "Original problem description:\nWrite a python function to find quotient of two numbers (rounded down to the nearest integer).\nWe have its functional test sample:\nassert find(10,3) == 3\nassert find(4,2) == 2\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n3\n\nOutput:\n3\n\n\nExample 2:\nInput:\n4\n2\n\nOutput:\n2\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 157,
"prompt": "Write a function to find the maximum value in a given heterogeneous list.",
"code": "def max_val(listval):\n max_val = max(i for i in listval if isinstance(i, int)) \n return(max_val)",
"test_imports": [],
"test_list": [
"assert max_val(['Python', 3, 2, 4, 5, 'version'])==5",
"assert max_val(['Python', 15, 20, 25])==25",
"assert max_val(['Python', 30, 20, 40, 50, 'version'])==50"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Python 3 2 4 5 version\n",
"Python 15 20 25\n",
"Python 30 20 40 50 version\n"
],
"test_output": [
"5\n",
"25\n",
"50\n"
],
"example_input": [
"Python 3 2 4 5 version\n",
"Python 15 20 25\n"
],
"example_output": [
"5\n",
"25\n"
],
"question": "Original problem description:\nWrite a function to find the maximum value in a given heterogeneous list.\nWe have its functional test sample:\nassert max_val(['Python', 3, 2, 4, 5, 'version'])==5\nassert max_val(['Python', 15, 20, 25])==25\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nPython 3 2 4 5 version\n\nOutput:\n5\n\n\nExample 2:\nInput:\nPython 15 20 25\n\nOutput:\n25\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 158,
"prompt": "Write a function to return the sum of all divisors of a number.",
"code": "def sum_div(number):\n divisors = [1]\n for i in range(2, number):\n if (number % i)==0:\n divisors.append(i)\n return sum(divisors)",
"test_imports": [],
"test_list": [
"assert sum_div(8)==7",
"assert sum_div(12)==16",
"assert sum_div(7)==1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"8\n",
"12\n",
"7\n"
],
"test_output": [
"7\n",
"16\n",
"1\n"
],
"example_input": [
"8\n",
"12\n"
],
"example_output": [
"7\n",
"16\n"
],
"question": "Original problem description:\nWrite a function to return the sum of all divisors of a number.\nWe have its functional test sample:\nassert sum_div(8)==7\nassert sum_div(12)==16\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n8\n\nOutput:\n7\n\n\nExample 2:\nInput:\n12\n\nOutput:\n16\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 159,
"prompt": "Write a python function to count inversions in an array.",
"code": "def get_Inv_Count(arr): \n inv_count = 0\n for i in range(len(arr)): \n for j in range(i + 1, len(arr)): \n if (arr[i] > arr[j]): \n inv_count += 1\n return inv_count ",
"test_imports": [],
"test_list": [
"assert get_Inv_Count([1,20,6,4,5]) == 5",
"assert get_Inv_Count([1,2,1]) == 1",
"assert get_Inv_Count([1,2,5,6,1]) == 3"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 20 6 4 5\n",
"1 2 1\n",
"1 2 5 6 1\n"
],
"test_output": [
"5\n",
"1\n",
"3\n"
],
"example_input": [
"1 20 6 4 5\n",
"1 2 1\n"
],
"example_output": [
"5\n",
"1\n"
],
"question": "Original problem description:\nWrite a python function to count inversions in an array.\nWe have its functional test sample:\nassert get_Inv_Count([1,20,6,4,5]) == 5\nassert get_Inv_Count([1,2,1]) == 1\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 20 6 4 5\n\nOutput:\n5\n\n\nExample 2:\nInput:\n1 2 1\n\nOutput:\n1\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 161,
"prompt": "Write a function to calculate the maximum aggregate from the list of tuples.",
"code": "from collections import defaultdict\ndef max_aggregate(stdata):\n temp = defaultdict(int)\n for name, marks in stdata:\n temp[name] += marks\n return max(temp.items(), key=lambda x: x[1])",
"test_imports": [],
"test_list": [
"assert max_aggregate([('Juan Whelan',90),('Sabah Colley',88),('Peter Nichols',7),('Juan Whelan',122),('Sabah Colley',84)])==('Juan Whelan', 212)",
"assert max_aggregate([('Juan Whelan',50),('Sabah Colley',48),('Peter Nichols',37),('Juan Whelan',22),('Sabah Colley',14)])==('Juan Whelan', 72)",
"assert max_aggregate([('Juan Whelan',10),('Sabah Colley',20),('Peter Nichols',30),('Juan Whelan',40),('Sabah Colley',50)])==('Sabah Colley', 70)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Juan Whelan 90\nSabah Colley 88\nPeter Nichols 7\nJuan Whelan 122\nSabah Colley 84\n",
"Juan Whelan 50\nSabah Colley 48\nPeter Nichols 37\nJuan Whelan 22\nSabah Colley 14\n",
"Juan Whelan 10\nSabah Colley 20\nPeter Nichols 30\nJuan Whelan 40\nSabah Colley 50\n"
],
"test_output": [
"Juan Whelan 212\n",
"Juan Whelan 72\n",
"Sabah Colley 70\n"
],
"example_input": [
"Juan Whelan 90\nSabah Colley 88\nPeter Nichols 7\nJuan Whelan 122\nSabah Colley 84\n",
"Juan Whelan 50\nSabah Colley 48\nPeter Nichols 37\nJuan Whelan 22\nSabah Colley 14\n"
],
"example_output": [
"Juan Whelan 212\n",
"Juan Whelan 72\n"
],
"question": "Original problem description:\nWrite a function to calculate the maximum aggregate from the list of tuples.\nWe have its functional test sample:\nassert max_aggregate([('Juan Whelan',90),('Sabah Colley',88),('Peter Nichols',7),('Juan Whelan',122),('Sabah Colley',84)])==('Juan Whelan', 212)\nassert max_aggregate([('Juan Whelan',50),('Sabah Colley',48),('Peter Nichols',37),('Juan Whelan',22),('Sabah Colley',14)])==('Juan Whelan', 72)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nJuan Whelan 90\nSabah Colley 88\nPeter Nichols 7\nJuan Whelan 122\nSabah Colley 84\n\nOutput:\nJuan Whelan 212\n\n\nExample 2:\nInput:\nJuan Whelan 50\nSabah Colley 48\nPeter Nichols 37\nJuan Whelan 22\nSabah Colley 14\n\nOutput:\nJuan Whelan 72\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 165,
"prompt": "Write a function to return two words from a list of words starting with letter 'p'.",
"code": "import re\ndef start_withp(words):\n for w in words:\n m = re.match(\"(P\\w+)\\W(P\\w+)\", w)\n if m:\n return m.groups()",
"test_imports": [],
"test_list": [
"assert start_withp([\"Python PHP\", \"Java JavaScript\", \"c c++\"])==('Python', 'PHP')",
"assert start_withp([\"Python Programming\",\"Java Programming\"])==('Python','Programming')",
"assert start_withp([\"Pqrst Pqr\",\"qrstuv\"])==('Pqrst','Pqr')"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Python PHP Java JavaScript c c++\n",
"Python Programming Java Programming\n",
"Pqrst Pqr qrstuv\n"
],
"test_output": [
"Python PHP\n",
"Python Programming\n",
"Pqrst Pqr\n"
],
"example_input": [
"Python PHP Java JavaScript c c++\n",
"Python Programming Java Programming\n"
],
"example_output": [
"Python PHP\n",
"Python Programming\n"
],
"question": "Original problem description:\nWrite a function to return two words from a list of words starting with letter 'p'.\nWe have its functional test sample:\nassert start_withp([\"Python PHP\", \"Java JavaScript\", \"c c++\"])==('Python', 'PHP')\nassert start_withp([\"Python Programming\",\"Java Programming\"])==('Python','Programming')\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nPython PHP Java JavaScript c c++\n\nOutput:\nPython PHP\n\n\nExample 2:\nInput:\nPython Programming Java Programming\n\nOutput:\nPython Programming\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 166,
"prompt": "Write a function to find the maximum sum of increasing subsequence from prefix until ith index and also including a given kth element which is after i, i.e., k > i .",
"code": "def max_sum_increasing_subseq(a, n, index, k):\n\tdp = [[0 for i in range(n)] \n\t\t\tfor i in range(n)]\n\tfor i in range(n):\n\t\tif a[i] > a[0]:\n\t\t\tdp[0][i] = a[i] + a[0]\n\t\telse:\n\t\t\tdp[0][i] = a[i]\n\tfor i in range(1, n):\n\t\tfor j in range(n):\n\t\t\tif a[j] > a[i] and j > i:\n\t\t\t\tif dp[i - 1][i] + a[j] > dp[i - 1][j]:\n\t\t\t\t\tdp[i][j] = dp[i - 1][i] + a[j]\n\t\t\t\telse:\n\t\t\t\t\tdp[i][j] = dp[i - 1][j]\n\t\t\telse:\n\t\t\t\tdp[i][j] = dp[i - 1][j]\n\treturn dp[index][k]",
"test_imports": [],
"test_list": [
"assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 4, 6) == 11",
"assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 2, 5) == 7",
"assert max_sum_increasing_subseq([11, 15, 19, 21, 26, 28, 31], 7, 2, 4) == 71"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 101 2 3 100 4 5\n7\n4\n6\n",
"1 101 2 3 100 4 5\n7\n2\n5\n",
"11 15 19 21 26 28 31\n7\n2\n4\n"
],
"test_output": [
"11\n",
"7\n",
"71\n"
],
"example_input": [
"1 101 2 3 100 4 5\n7\n4\n6\n",
"1 101 2 3 100 4 5\n7\n2\n5\n"
],
"example_output": [
"11\n",
"7\n"
],
"question": "Original problem description:\nWrite a function to find the maximum sum of increasing subsequence from prefix until ith index and also including a given kth element which is after i, i.e., k > i .\nWe have its functional test sample:\nassert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 4, 6) == 11\nassert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 2, 5) == 7\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 101 2 3 100 4 5\n7\n4\n6\n\nOutput:\n11\n\n\nExample 2:\nInput:\n1 101 2 3 100 4 5\n7\n2\n5\n\nOutput:\n7\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 168,
"prompt": "Write a function to find the specified number of largest products from two given lists, selecting one factor from each list.",
"code": "def large_product(nums1, nums2, N):\n result = sorted([x*y for x in nums1 for y in nums2], reverse=True)[:N]\n return result",
"test_imports": [],
"test_list": [
"assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],3)==[60, 54, 50]",
"assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],4)==[60, 54, 50, 48]",
"assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],5)==[60, 54, 50, 48, 45]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5 6\n3 6 8 9 10 6\n3\n",
"1 2 3 4 5 6\n3 6 8 9 10 6\n4\n",
"1 2 3 4 5 6\n3 6 8 9 10 6\n5\n"
],
"test_output": [
"60 54 50\n",
"60 54 50 48\n",
"60 54 50 48 45\n"
],
"example_input": [
"1 2 3 4 5 6\n3 6 8 9 10 6\n3\n",
"1 2 3 4 5 6\n3 6 8 9 10 6\n4\n"
],
"example_output": [
"60 54 50\n",
"60 54 50 48\n"
],
"question": "Original problem description:\nWrite a function to find the specified number of largest products from two given lists, selecting one factor from each list.\nWe have its functional test sample:\nassert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],3)==[60, 54, 50]\nassert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],4)==[60, 54, 50, 48]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5 6\n3 6 8 9 10 6\n3\n\nOutput:\n60 54 50\n\n\nExample 2:\nInput:\n1 2 3 4 5 6\n3 6 8 9 10 6\n4\n\nOutput:\n60 54 50 48\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 169,
"prompt": "Write a python function to find the maximum of two numbers.",
"code": "def maximum(a,b): \n if a >= b: \n return a \n else: \n return b ",
"test_imports": [],
"test_list": [
"assert maximum(5,10) == 10",
"assert maximum(-1,-2) == -1",
"assert maximum(9,7) == 9"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n10\n",
"-1\n-2\n",
"9\n7\n"
],
"test_output": [
"10\n",
"-1\n",
"9\n"
],
"example_input": [
"5\n10\n",
"-1\n-2\n"
],
"example_output": [
"10\n",
"-1\n"
],
"question": "Original problem description:\nWrite a python function to find the maximum of two numbers.\nWe have its functional test sample:\nassert maximum(5,10) == 10\nassert maximum(-1,-2) == -1\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n10\n\nOutput:\n10\n\n\nExample 2:\nInput:\n-1\n-2\n\nOutput:\n-1\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 170,
"prompt": "Write a function to convert a given string to a tuple of characters.",
"code": "def string_to_tuple(str1):\n result = tuple(x for x in str1 if not x.isspace()) \n return result",
"test_imports": [],
"test_list": [
"assert string_to_tuple(\"python 3.0\")==('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')",
"assert string_to_tuple(\"item1\")==('i', 't', 'e', 'm', '1')",
"assert string_to_tuple(\"15.10\")==('1', '5', '.', '1', '0')"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"python 3.0\n",
"item1\n",
"15.10\n"
],
"test_output": [
"p y t h o n 3 . 0\n",
"i t e m 1\n",
"1 5 . 1 0\n"
],
"example_input": [
"python 3.0\n",
"item1\n"
],
"example_output": [
"p y t h o n 3 . 0\n",
"i t e m 1\n"
],
"question": "Original problem description:\nWrite a function to convert a given string to a tuple of characters.\nWe have its functional test sample:\nassert string_to_tuple(\"python 3.0\")==('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')\nassert string_to_tuple(\"item1\")==('i', 't', 'e', 'm', '1')\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npython 3.0\n\nOutput:\np y t h o n 3 . 0\n\n\nExample 2:\nInput:\nitem1\n\nOutput:\ni t e m 1\n\n\n"
},
{
"source_file": "Ellen's Copy of Benchmark Questions Verification V2.ipynb",
"task_id": 171,
"prompt": "Write a python function to set the left most unset bit.",
"code": "def set_left_most_unset_bit(n): \n if not (n & (n + 1)): \n return n \n pos, temp, count = 0, n, 0 \n while temp: \n if not (temp & 1): \n pos = count \n count += 1; temp>>=1\n return (n | (1 << (pos))) ",
"test_imports": [],
"test_list": [
"assert set_left_most_unset_bit(10) == 14",
"assert set_left_most_unset_bit(12) == 14",
"assert set_left_most_unset_bit(15) == 15"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n",
"12\n",
"15\n"
],
"test_output": [
"14\n",
"14\n",
"15\n"
],
"example_input": [
"10\n",
"12\n"
],
"example_output": [
"14\n",
"14\n"
],
"question": "Original problem description:\nWrite a python function to set the left most unset bit.\nWe have its functional test sample:\nassert set_left_most_unset_bit(10) == 14\nassert set_left_most_unset_bit(12) == 14\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n\nOutput:\n14\n\n\nExample 2:\nInput:\n12\n\nOutput:\n14\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 173,
"prompt": "Write a python function to find the highest power of 2 that is less than or equal to n.",
"code": "def highest_Power_of_2(n): \n res = 0 \n for i in range(n, 0, -1): \n if ((i & (i - 1)) == 0): \n res = i \n break \n return res ",
"test_imports": [],
"test_list": [
"assert highest_Power_of_2(10) == 8",
"assert highest_Power_of_2(19) == 16",
"assert highest_Power_of_2(32) == 32"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n",
"19\n",
"32\n"
],
"test_output": [
"8\n",
"16\n",
"32\n"
],
"example_input": [
"10\n",
"19\n"
],
"example_output": [
"8\n",
"16\n"
],
"question": "Original problem description:\nWrite a python function to find the highest power of 2 that is less than or equal to n.\nWe have its functional test sample:\nassert highest_Power_of_2(10) == 8\nassert highest_Power_of_2(19) == 16\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n\nOutput:\n8\n\n\nExample 2:\nInput:\n19\n\nOutput:\n16\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 174,
"prompt": "Write a function to find the n'th lucas number.",
"code": "def find_lucas(n): \n\tif (n == 0): \n\t\treturn 2\n\tif (n == 1): \n\t\treturn 1\n\treturn find_lucas(n - 1) + find_lucas(n - 2) ",
"test_imports": [],
"test_list": [
"assert find_lucas(9) == 76",
"assert find_lucas(4) == 7",
"assert find_lucas(3) == 4"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"9\n",
"4\n",
"3\n"
],
"test_output": [
"76\n",
"7\n",
"4\n"
],
"example_input": [
"9\n",
"4\n"
],
"example_output": [
"76\n",
"7\n"
],
"question": "Original problem description:\nWrite a function to find the n'th lucas number.\nWe have its functional test sample:\nassert find_lucas(9) == 76\nassert find_lucas(4) == 7\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n9\n\nOutput:\n76\n\n\nExample 2:\nInput:\n4\n\nOutput:\n7\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 175,
"prompt": "Write a function to apply a given format string to all of the elements in a list.",
"code": "def add_string(list_, string):\n add_string=[string.format(i) for i in list_]\n return add_string",
"test_imports": [],
"test_list": [
"assert add_string([1,2,3,4],'temp{0}')==['temp1', 'temp2', 'temp3', 'temp4']",
"assert add_string(['a','b','c','d'], 'python{0}')==[ 'pythona', 'pythonb', 'pythonc', 'pythond']",
"assert add_string([5,6,7,8],'string{0}')==['string5', 'string6', 'string7', 'string8']"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4\ntemp{0}\n",
"a b c d\npython{0}\n",
"5 6 7 8\nstring{0}\n"
],
"test_output": [
"temp1 temp2 temp3 temp4\n",
"pythona pythonb pythonc pythond\n",
"string5 string6 string7 string8\n"
],
"example_input": [
"1 2 3 4\ntemp{0}\n",
"a b c d\npython{0}\n"
],
"example_output": [
"temp1 temp2 temp3 temp4\n",
"pythona pythonb pythonc pythond\n"
],
"question": "Original problem description:\nWrite a function to apply a given format string to all of the elements in a list.\nWe have its functional test sample:\nassert add_string([1,2,3,4],'temp{0}')==['temp1', 'temp2', 'temp3', 'temp4']\nassert add_string(['a','b','c','d'], 'python{0}')==[ 'pythona', 'pythonb', 'pythonc', 'pythond']\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4\ntemp{0}\n\nOutput:\ntemp1 temp2 temp3 temp4\n\n\nExample 2:\nInput:\na b c d\npython{0}\n\nOutput:\npythona pythonb pythonc pythond\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 177,
"prompt": "Write a function to find the maximum sum possible by using the given equation f(n) = max( (f(n/2) + f(n/3) + f(n/4) + f(n/5)), n).",
"code": "def get_max_sum (n):\n\tres = list()\n\tres.append(0)\n\tres.append(1)\n\ti = 2\n\twhile i<n + 1:\n\t\tres.append(max(i, (res[int(i / 2)] \n\t\t\t\t\t\t+ res[int(i / 3)] +\n\t\t\t\t\t\t\tres[int(i / 4)]\n\t\t\t\t\t\t+ res[int(i / 5)])))\n\t\ti = i + 1\n\treturn res[n]",
"test_imports": [],
"test_list": [
"assert get_max_sum(60) == 106",
"assert get_max_sum(10) == 12",
"assert get_max_sum(2) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"60\n",
"10\n",
"2\n"
],
"test_output": [
"106\n",
"12\n",
"2\n"
],
"example_input": [
"60\n",
"10\n"
],
"example_output": [
"106\n",
"12\n"
],
"question": "Original problem description:\nWrite a function to find the maximum sum possible by using the given equation f(n) = max( (f(n/2) + f(n/3) + f(n/4) + f(n/5)), n).\nWe have its functional test sample:\nassert get_max_sum(60) == 106\nassert get_max_sum(10) == 12\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n60\n\nOutput:\n106\n\n\nExample 2:\nInput:\n10\n\nOutput:\n12\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 178,
"prompt": "Write a function to find the list with maximum length.",
"code": "def max_length_list(input_list):\n max_length = max(len(x) for x in input_list ) \n max_list = max(input_list, key = lambda i: len(i)) \n return(max_length, max_list)",
"test_imports": [],
"test_list": [
"assert max_length_list([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])",
"assert max_length_list([[1,2,3,4,5],[1,2,3,4],[1,2,3],[1,2],[1]])==(5,[1,2,3,4,5])",
"assert max_length_list([[3,4,5],[6,7,8,9],[10,11,12]])==(4,[6,7,8,9])"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"0\n1 3\n5 7\n9 11\n13 15 17\n",
"1 2 3 4 5\n1 2 3 4\n1 2 3\n1 2\n1\n",
"3 4 5\n6 7 8 9\n10 11 12\n"
],
"test_output": [
"3 [13, 15, 17]\n",
"5 [1, 2, 3, 4, 5]\n",
"4 [6, 7, 8, 9]\n"
],
"example_input": [
"0\n1 3\n5 7\n9 11\n13 15 17\n",
"1 2 3 4 5\n1 2 3 4\n1 2 3\n1 2\n1\n"
],
"example_output": [
"3 [13, 15, 17]\n",
"5 [1, 2, 3, 4, 5]\n"
],
"question": "Original problem description:\nWrite a function to find the list with maximum length.\nWe have its functional test sample:\nassert max_length_list([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])\nassert max_length_list([[1,2,3,4,5],[1,2,3,4],[1,2,3],[1,2],[1]])==(5,[1,2,3,4,5])\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n0\n1 3\n5 7\n9 11\n13 15 17\n\nOutput:\n3 [13, 15, 17]\n\n\nExample 2:\nInput:\n1 2 3 4 5\n1 2 3 4\n1 2 3\n1 2\n1\n\nOutput:\n5 [1, 2, 3, 4, 5]\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 179,
"prompt": "Write a function to check if given tuple contains no duplicates.",
"code": "def check_distinct(test_tup):\n res = True\n temp = set()\n for ele in test_tup:\n if ele in temp:\n res = False\n break\n temp.add(ele)\n return res ",
"test_imports": [],
"test_list": [
"assert check_distinct((1, 4, 5, 6, 1, 4)) == False",
"assert check_distinct((1, 4, 5, 6)) == True",
"assert check_distinct((2, 3, 4, 5, 6)) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n4\n5\n6\n1\n4\n",
"1\n4\n5\n6\n",
"2\n3\n4\n5\n6\n"
],
"test_output": [
"False\n",
"True\n",
"True\n"
],
"example_input": [
"1\n4\n5\n6\n1\n4\n",
"1\n4\n5\n6\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a function to check if given tuple contains no duplicates.\nWe have its functional test sample:\nassert check_distinct((1, 4, 5, 6, 1, 4)) == False\nassert check_distinct((1, 4, 5, 6)) == True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n4\n5\n6\n1\n4\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n1\n4\n5\n6\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 180,
"prompt": "Write a python function to find the first non-repeated character in a given string.",
"code": "def first_non_repeating_character(str1):\n char_order = []\n ctr = {}\n for c in str1:\n if c in ctr:\n ctr[c] += 1\n else:\n ctr[c] = 1 \n char_order.append(c)\n for c in char_order:\n if ctr[c] == 1:\n return c\n return None",
"test_imports": [],
"test_list": [
"assert first_non_repeating_character(\"abcabc\") == None",
"assert first_non_repeating_character(\"abc\") == \"a\"",
"assert first_non_repeating_character(\"ababc\") == \"c\""
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"abcabc\n",
"abc\n",
"ababc\n"
],
"test_output": [
"None\n",
"a\n",
"c\n"
],
"example_input": [
"abcabc\n",
"abc\n"
],
"example_output": [
"None\n",
"a\n"
],
"question": "Original problem description:\nWrite a python function to find the first non-repeated character in a given string.\nWe have its functional test sample:\nassert first_non_repeating_character(\"abcabc\") == None\nassert first_non_repeating_character(\"abc\") == \"a\"\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nabcabc\n\nOutput:\nNone\n\n\nExample 2:\nInput:\nabc\n\nOutput:\na\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 181,
"prompt": "Write a function to check whether the given string starts and ends with the same character or not.",
"code": "import re \nregex = r'^[a-z]$|^([a-z]).*\\1$'\ndef check_char(string): \n\tif(re.search(regex, string)): \n\t\treturn \"Valid\" \n\telse: \n\t\treturn \"Invalid\" ",
"test_imports": [],
"test_list": [
"assert check_char(\"abba\") == \"Valid\"",
"assert check_char(\"a\") == \"Valid\"",
"assert check_char(\"abcd\") == \"Invalid\""
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"abba\n",
"a\n",
"abcd\n"
],
"test_output": [
"Valid\n",
"Valid\n",
"Invalid\n"
],
"example_input": [
"abba\n",
"a\n"
],
"example_output": [
"Valid\n",
"Valid\n"
],
"question": "Original problem description:\nWrite a function to check whether the given string starts and ends with the same character or not.\nWe have its functional test sample:\nassert check_char(\"abba\") == \"Valid\"\nassert check_char(\"a\") == \"Valid\"\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nabba\n\nOutput:\nValid\n\n\nExample 2:\nInput:\na\n\nOutput:\nValid\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 182,
"prompt": "Write a function to find the median of three numbers.",
"code": "def median_numbers(a,b,c):\n if a > b:\n if a < c:\n median = a\n elif b > c:\n median = b\n else:\n median = c\n else:\n if a > c:\n median = a\n elif b < c:\n median = b\n else:\n median = c\n return median",
"test_imports": [],
"test_list": [
"assert median_numbers(25,55,65)==55.0",
"assert median_numbers(20,10,30)==20.0",
"assert median_numbers(15,45,75)==45.0"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"25\n55\n65\n",
"20\n10\n30\n",
"15\n45\n75\n"
],
"test_output": [
"55.0\n",
"20.0\n",
"45.0\n"
],
"example_input": [
"25\n55\n65\n",
"20\n10\n30\n"
],
"example_output": [
"55.0\n",
"20.0\n"
],
"question": "Original problem description:\nWrite a function to find the median of three numbers.\nWe have its functional test sample:\nassert median_numbers(25,55,65)==55.0\nassert median_numbers(20,10,30)==20.0\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n25\n55\n65\n\nOutput:\n55.0\n\n\nExample 2:\nInput:\n20\n10\n30\n\nOutput:\n20.0\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 183,
"prompt": "Write a function to compute the sum of digits of each number of a given list.",
"code": "def sum_of_digits(nums):\n return sum(int(el) for n in nums for el in str(n) if el.isdigit())",
"test_imports": [],
"test_list": [
"assert sum_of_digits([10,2,56])==14",
"assert sum_of_digits([[10,20,4,5,'b',70,'a']])==19",
"assert sum_of_digits([10,20,-4,5,-70])==19"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 2 56\n",
"10 20 4 5 b 70 a\n",
"10 20 -4 5 -70\n"
],
"test_output": [
"14\n",
"19\n",
"19\n"
],
"example_input": [
"10 2 56\n",
"10 20 4 5 b 70 a\n"
],
"example_output": [
"14\n",
"19\n"
],
"question": "Original problem description:\nWrite a function to compute the sum of digits of each number of a given list.\nWe have its functional test sample:\nassert sum_of_digits([10,2,56])==14\nassert sum_of_digits([[10,20,4,5,'b',70,'a']])==19\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 2 56\n\nOutput:\n14\n\n\nExample 2:\nInput:\n10 20 4 5 b 70 a\n\nOutput:\n19\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 184,
"prompt": "Write a function to perform the mathematical bitwise xor operation across the given tuples.",
"code": "def bitwise_xor(test_tup1, test_tup2):\n res = tuple(ele1 ^ ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\n return (res) ",
"test_imports": [],
"test_list": [
"assert bitwise_xor((10, 4, 6, 9), (5, 2, 3, 3)) == (15, 6, 5, 10)",
"assert bitwise_xor((11, 5, 7, 10), (6, 3, 4, 4)) == (13, 6, 3, 14)",
"assert bitwise_xor((12, 6, 8, 11), (7, 4, 5, 6)) == (11, 2, 13, 13)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 4 6 9\n5 2 3 3\n",
"11 5 7 10\n6 3 4 4\n",
"12 6 8 11\n7 4 5 6\n"
],
"test_output": [
"15 6 5 10\n",
"13 6 3 14\n",
"11 2 13 13\n"
],
"example_input": [
"10 4 6 9\n5 2 3 3\n",
"11 5 7 10\n6 3 4 4\n"
],
"example_output": [
"15 6 5 10\n",
"13 6 3 14\n"
],
"question": "Original problem description:\nWrite a function to perform the mathematical bitwise xor operation across the given tuples.\nWe have its functional test sample:\nassert bitwise_xor((10, 4, 6, 9), (5, 2, 3, 3)) == (15, 6, 5, 10)\nassert bitwise_xor((11, 5, 7, 10), (6, 3, 4, 4)) == (13, 6, 3, 14)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 4 6 9\n5 2 3 3\n\nOutput:\n15 6 5 10\n\n\nExample 2:\nInput:\n11 5 7 10\n6 3 4 4\n\nOutput:\n13 6 3 14\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 185,
"prompt": "Write a function to extract the number of unique tuples in the given list.",
"code": "def extract_freq(test_list):\n res = len(list(set(tuple(sorted(sub)) for sub in test_list)))\n return (res)",
"test_imports": [],
"test_list": [
"assert extract_freq([(3, 4), (1, 2), (4, 3), (5, 6)] ) == 3",
"assert extract_freq([(4, 15), (2, 3), (5, 4), (6, 7)] ) == 4",
"assert extract_freq([(5, 16), (2, 3), (6, 5), (6, 9)] ) == 4"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3 4\n1 2\n4 3\n5 6\n",
"4 15\n2 3\n5 4\n6 7\n",
"5 16\n2 3\n6 5\n6 9\n"
],
"test_output": [
"3\n",
"4\n",
"4\n"
],
"example_input": [
"3 4\n1 2\n4 3\n5 6\n",
"4 15\n2 3\n5 4\n6 7\n"
],
"example_output": [
"3\n",
"4\n"
],
"question": "Original problem description:\nWrite a function to extract the number of unique tuples in the given list.\nWe have its functional test sample:\nassert extract_freq([(3, 4), (1, 2), (4, 3), (5, 6)] ) == 3\nassert extract_freq([(4, 15), (2, 3), (5, 4), (6, 7)] ) == 4\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3 4\n1 2\n4 3\n5 6\n\nOutput:\n3\n\n\nExample 2:\nInput:\n4 15\n2 3\n5 4\n6 7\n\nOutput:\n4\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 187,
"prompt": "Write a python function to find the minimum of two numbers.",
"code": "def minimum(a,b): \n if a <= b: \n return a \n else: \n return b ",
"test_imports": [],
"test_list": [
"assert minimum(1,2) == 1",
"assert minimum(-5,-4) == -5",
"assert minimum(0,0) == 0"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n2\n",
"-5\n-4\n",
"0\n0\n"
],
"test_output": [
"1\n",
"-5\n",
"0\n"
],
"example_input": [
"1\n2\n",
"-5\n-4\n"
],
"example_output": [
"1\n",
"-5\n"
],
"question": "Original problem description:\nWrite a python function to find the minimum of two numbers.\nWe have its functional test sample:\nassert minimum(1,2) == 1\nassert minimum(-5,-4) == -5\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n2\n\nOutput:\n1\n\n\nExample 2:\nInput:\n-5\n-4\n\nOutput:\n-5\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 188,
"prompt": "Write a function to check whether an element exists within a tuple.",
"code": "def check_tuplex(tuplex,tuple1): \n if tuple1 in tuplex:\n return True\n else:\n return False",
"test_imports": [],
"test_list": [
"assert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\", \"e\"),'r')==True",
"assert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\", \"e\"),'5')==False",
"assert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\",\"e\"),3)==True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"w 3 r e s o u r c e\nr\n",
"w 3 r e s o u r c e\n5\n",
"w 3 r e s o u r c e\n3\n"
],
"test_output": [
"True\n",
"False\n",
"True\n"
],
"example_input": [
"w 3 r e s o u r c e\nr\n",
"w 3 r e s o u r c e\n5\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to check whether an element exists within a tuple.\nWe have its functional test sample:\nassert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\", \"e\"),'r')==True\nassert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\", \"e\"),'5')==False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nw 3 r e s o u r c e\nr\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\nw 3 r e s o u r c e\n5\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 189,
"prompt": "Write a python function to find whether the parity of a given number is odd.",
"code": "def find_Parity(x): \n y = x ^ (x >> 1); \n y = y ^ (y >> 2); \n y = y ^ (y >> 4); \n y = y ^ (y >> 8); \n y = y ^ (y >> 16); \n if (y & 1): \n return True\n return False",
"test_imports": [],
"test_list": [
"assert find_Parity(12) == False",
"assert find_Parity(7) == True",
"assert find_Parity(10) == False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"12\n",
"7\n",
"10\n"
],
"test_output": [
"False\n",
"True\n",
"False\n"
],
"example_input": [
"12\n",
"7\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a python function to find whether the parity of a given number is odd.\nWe have its functional test sample:\nassert find_Parity(12) == False\nassert find_Parity(7) == True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n12\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n7\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 190,
"prompt": "Write a function to create the next bigger number by rearranging the digits of a given number.",
"code": "def rearrange_bigger(n):\n nums = list(str(n))\n for i in range(len(nums)-2,-1,-1):\n if nums[i] < nums[i+1]:\n z = nums[i:]\n y = min(filter(lambda x: x > z[0], z))\n z.remove(y)\n z.sort()\n nums[i:] = [y] + z\n return int(\"\".join(nums))\n return False",
"test_imports": [],
"test_list": [
"assert rearrange_bigger(12)==21",
"assert rearrange_bigger(10)==False",
"assert rearrange_bigger(102)==120"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"12\n",
"10\n",
"102\n"
],
"test_output": [
"21\n",
"False\n",
"120\n"
],
"example_input": [
"12\n",
"10\n"
],
"example_output": [
"21\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to create the next bigger number by rearranging the digits of a given number.\nWe have its functional test sample:\nassert rearrange_bigger(12)==21\nassert rearrange_bigger(10)==False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n12\n\nOutput:\n21\n\n\nExample 2:\nInput:\n10\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 191,
"prompt": "Write a function to find k number of smallest pairs which consist of one element from the first array and one element from the second array.",
"code": "import heapq\ndef k_smallest_pairs(nums1, nums2, k):\n queue = []\n def push(i, j):\n if i < len(nums1) and j < len(nums2):\n heapq.heappush(queue, [nums1[i] + nums2[j], i, j])\n push(0, 0)\n pairs = []\n while queue and len(pairs) < k:\n _, i, j = heapq.heappop(queue)\n pairs.append([nums1[i], nums2[j]])\n push(i, j + 1)\n if j == 0:\n push(i + 1, 0)\n return pairs",
"test_imports": [],
"test_list": [
"assert k_smallest_pairs([1,3,7],[2,4,6],2)==[[1, 2], [1, 4]]",
"assert k_smallest_pairs([1,3,7],[2,4,6],1)==[[1, 2]]",
"assert k_smallest_pairs([1,3,7],[2,4,6],7)==[[1, 2], [1, 4], [3, 2], [1, 6], [3, 4], [3, 6], [7, 2]]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 3 7\n2 4 6\n2\n",
"1 3 7\n2 4 6\n1\n",
"1 3 7\n2 4 6\n7\n"
],
"test_output": [
"1 2\n1 4\n",
"1 2\n",
"1 2\n1 4\n3 2\n1 6\n3 4\n3 6\n7 2\n"
],
"example_input": [
"1 3 7\n2 4 6\n2\n",
"1 3 7\n2 4 6\n1\n"
],
"example_output": [
"1 2\n1 4\n",
"1 2\n"
],
"question": "Original problem description:\nWrite a function to find k number of smallest pairs which consist of one element from the first array and one element from the second array.\nWe have its functional test sample:\nassert k_smallest_pairs([1,3,7],[2,4,6],2)==[[1, 2], [1, 4]]\nassert k_smallest_pairs([1,3,7],[2,4,6],1)==[[1, 2]]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 3 7\n2 4 6\n2\n\nOutput:\n1 2\n1 4\n\n\nExample 2:\nInput:\n1 3 7\n2 4 6\n1\n\nOutput:\n1 2\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 192,
"prompt": "Write a function to find the minimum product from the pairs of tuples within a given list.",
"code": "def min_product_tuple(list1):\n result_min = min([abs(x * y) for x, y in list1] )\n return result_min",
"test_imports": [],
"test_list": [
"assert min_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==8",
"assert min_product_tuple([(10,20), (15,2), (5,10)] )==30",
"assert min_product_tuple([(11,44), (10,15), (20,5), (12, 9)] )==100"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2 7\n2 6\n1 8\n4 9\n",
"10 20\n15 2\n5 10\n",
"11 44\n10 15\n20 5\n12 9\n"
],
"test_output": [
"8\n",
"30\n",
"100\n"
],
"example_input": [
"2 7\n2 6\n1 8\n4 9\n",
"10 20\n15 2\n5 10\n"
],
"example_output": [
"8\n",
"30\n"
],
"question": "Original problem description:\nWrite a function to find the minimum product from the pairs of tuples within a given list.\nWe have its functional test sample:\nassert min_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==8\nassert min_product_tuple([(10,20), (15,2), (5,10)] )==30\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2 7\n2 6\n1 8\n4 9\n\nOutput:\n8\n\n\nExample 2:\nInput:\n10 20\n15 2\n5 10\n\nOutput:\n30\n\n\n"
},
{
"source_file": "Benchmark Questions Verification V2.ipynb",
"task_id": 193,
"prompt": "Write a function to find the minimum value in a given heterogeneous list.",
"code": "def min_val(listval):\n min_val = min(i for i in listval if isinstance(i, int))\n return min_val",
"test_imports": [],
"test_list": [
"assert min_val(['Python', 3, 2, 4, 5, 'version'])==2",
"assert min_val(['Python', 15, 20, 25])==15",
"assert min_val(['Python', 30, 20, 40, 50, 'version'])==20"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Python 3 2 4 5 version\n",
"Python 15 20 25\n",
"Python 30 20 40 50 version\n"
],
"test_output": [
"2\n",
"15\n",
"20\n"
],
"example_input": [
"Python 3 2 4 5 version\n",
"Python 15 20 25\n"
],
"example_output": [
"2\n",
"15\n"
],
"question": "Original problem description:\nWrite a function to find the minimum value in a given heterogeneous list.\nWe have its functional test sample:\nassert min_val(['Python', 3, 2, 4, 5, 'version'])==2\nassert min_val(['Python', 15, 20, 25])==15\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nPython 3 2 4 5 version\n\nOutput:\n2\n\n\nExample 2:\nInput:\nPython 15 20 25\n\nOutput:\n15\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 194,
"prompt": "Write a function to convert the given snake case string to camel case string.",
"code": "import re\ndef snake_to_camel(word):\n return ''.join(x.capitalize() or '_' for x in word.split('_'))",
"test_imports": [],
"test_list": [
"assert snake_to_camel('android_tv') == 'AndroidTv'",
"assert snake_to_camel('google_pixel') == 'GooglePixel'",
"assert snake_to_camel('apple_watch') == 'AppleWatch'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"android_tv\n",
"google_pixel\n",
"apple_watch\n"
],
"test_output": [
"AndroidTv\n",
"GooglePixel\n",
"AppleWatch\n"
],
"example_input": [
"android_tv\n",
"google_pixel\n"
],
"example_output": [
"AndroidTv\n",
"GooglePixel\n"
],
"question": "Original problem description:\nWrite a function to convert the given snake case string to camel case string.\nWe have its functional test sample:\nassert snake_to_camel('android_tv') == 'AndroidTv'\nassert snake_to_camel('google_pixel') == 'GooglePixel'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nandroid_tv\n\nOutput:\nAndroidTv\n\n\nExample 2:\nInput:\ngoogle_pixel\n\nOutput:\nGooglePixel\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 195,
"prompt": "Write a python function to remove odd numbers from a given list.",
"code": "def remove_odd(l):\n for i in l:\n if i % 2 != 0:\n l.remove(i)\n return l",
"test_imports": [],
"test_list": [
"assert remove_odd([1,2,3]) == [2]",
"assert remove_odd([2,4,6]) == [2,4,6]",
"assert remove_odd([10,20,3]) == [10,20]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3\n",
"2 4 6\n",
"10 20 3\n"
],
"test_output": [
"2\n",
"2 4 6\n",
"10 20\n"
],
"example_input": [
"1 2 3\n",
"2 4 6\n"
],
"example_output": [
"2\n",
"2 4 6\n"
],
"question": "Original problem description:\nWrite a python function to remove odd numbers from a given list.\nWe have its functional test sample:\nassert remove_odd([1,2,3]) == [2]\nassert remove_odd([2,4,6]) == [2,4,6]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3\n\nOutput:\n2\n\n\nExample 2:\nInput:\n2 4 6\n\nOutput:\n2 4 6\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 197,
"prompt": "Write a python function to check whether any value in a sequence exists in a sequence or not.",
"code": "def overlapping(list1,list2): \n for i in range(len(list1)): \n for j in range(len(list2)): \n if(list1[i]==list2[j]): \n return True\n return False",
"test_imports": [],
"test_list": [
"assert overlapping([1,2,3,4,5],[6,7,8,9]) == False",
"assert overlapping([1,2,3],[4,5,6]) == False",
"assert overlapping([1,4,5],[1,4,5]) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5\n6 7 8 9\n",
"1 2 3\n4 5 6\n",
"1 4 5\n1 4 5\n"
],
"test_output": [
"False\n",
"False\n",
"True\n"
],
"example_input": [
"1 2 3 4 5\n6 7 8 9\n",
"1 2 3\n4 5 6\n"
],
"example_output": [
"False\n",
"False\n"
],
"question": "Original problem description:\nWrite a python function to check whether any value in a sequence exists in a sequence or not.\nWe have its functional test sample:\nassert overlapping([1,2,3,4,5],[6,7,8,9]) == False\nassert overlapping([1,2,3],[4,5,6]) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5\n6 7 8 9\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n1 2 3\n4 5 6\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 198,
"prompt": "Write a python function to find a pair with highest product from a given array of integers.",
"code": "def max_Product(arr): \n arr_len = len(arr) \n if (arr_len < 2): \n return (\"No pairs exists\") \n x = arr[0]; y = arr[1] \n for i in range(0,arr_len): \n for j in range(i + 1,arr_len): \n if (arr[i] * arr[j] > x * y): \n x = arr[i]; y = arr[j] \n return x,y ",
"test_imports": [],
"test_list": [
"assert max_Product([1,2,3,4,7,0,8,4]) == (7,8)",
"assert max_Product([0,-1,-2,-4,5,0,-6]) == (-4,-6)",
"assert max_Product([1,2,3]) == (2,3)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 7 0 8 4\n",
"0 -1 -2 -4 5 0 -6\n",
"1 2 3\n"
],
"test_output": [
"7 8\n",
"-4 -6\n",
"2 3\n"
],
"example_input": [
"1 2 3 4 7 0 8 4\n",
"0 -1 -2 -4 5 0 -6\n"
],
"example_output": [
"7 8\n",
"-4 -6\n"
],
"question": "Original problem description:\nWrite a python function to find a pair with highest product from a given array of integers.\nWe have its functional test sample:\nassert max_Product([1,2,3,4,7,0,8,4]) == (7,8)\nassert max_Product([0,-1,-2,-4,5,0,-6]) == (-4,-6)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 7 0 8 4\n\nOutput:\n7 8\n\n\nExample 2:\nInput:\n0 -1 -2 -4 5 0 -6\n\nOutput:\n-4 -6\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 199,
"prompt": "Write a function to find common first element in given list of tuple.",
"code": "def group_tuples(Input): \n\tout = {} \n\tfor elem in Input: \n\t\ttry: \n\t\t\tout[elem[0]].extend(elem[1:]) \n\t\texcept KeyError: \n\t\t\tout[elem[0]] = list(elem) \n\treturn [tuple(values) for values in out.values()] ",
"test_imports": [],
"test_list": [
"assert group_tuples([('x', 'y'), ('x', 'z'), ('w', 't')]) == [('x', 'y', 'z'), ('w', 't')]",
"assert group_tuples([('a', 'b'), ('a', 'c'), ('d', 'e')]) == [('a', 'b', 'c'), ('d', 'e')]",
"assert group_tuples([('f', 'g'), ('f', 'g'), ('h', 'i')]) == [('f', 'g', 'g'), ('h', 'i')]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"x y\nx z\nw t\n",
"a b\na c\nd e\n",
"f g\nf g\nh i\n"
],
"test_output": [
"x y z\nw t\n",
"a b c\nd e\n",
"f g g\nh i\n"
],
"example_input": [
"x y\nx z\nw t\n",
"a b\na c\nd e\n"
],
"example_output": [
"x y z\nw t\n",
"a b c\nd e\n"
],
"question": "Original problem description:\nWrite a function to find common first element in given list of tuple.\nWe have its functional test sample:\nassert group_tuples([('x', 'y'), ('x', 'z'), ('w', 't')]) == [('x', 'y', 'z'), ('w', 't')]\nassert group_tuples([('a', 'b'), ('a', 'c'), ('d', 'e')]) == [('a', 'b', 'c'), ('d', 'e')]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nx y\nx z\nw t\n\nOutput:\nx y z\nw t\n\n\nExample 2:\nInput:\na b\na c\nd e\n\nOutput:\na b c\nd e\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 200,
"prompt": "Write a python function to find the element of a list having maximum length.",
"code": "def Find_Max(lst): \n maxList = max((x) for x in lst) \n return maxList",
"test_imports": [],
"test_list": [
"assert Find_Max([['A'],['A','B'],['A','B','C']]) == ['A','B','C']",
"assert Find_Max([[1],[1,2],[1,2,3]]) == [1,2,3]",
"assert Find_Max([[1,1],[1,2,3],[1,5,6,1]]) == [1,5,6,1]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"A\nA B\nA B C\n",
"1\n1 2\n1 2 3\n",
"1 1\n1 2 3\n1 5 6 1\n"
],
"test_output": [
"A B C\n",
"1 2 3\n",
"1 5 6 1\n"
],
"example_input": [
"A\nA B\nA B C\n",
"1\n1 2\n1 2 3\n"
],
"example_output": [
"A B C\n",
"1 2 3\n"
],
"question": "Original problem description:\nWrite a python function to find the element of a list having maximum length.\nWe have its functional test sample:\nassert Find_Max([['A'],['A','B'],['A','B','C']]) == ['A','B','C']\nassert Find_Max([[1],[1,2],[1,2,3]]) == [1,2,3]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nA\nA B\nA B C\n\nOutput:\nA B C\n\n\nExample 2:\nInput:\n1\n1 2\n1 2 3\n\nOutput:\n1 2 3\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 201,
"prompt": "Write a function to round every number of a given list of numbers and print the total sum multiplied by the length of the list.",
"code": "def round_and_sum(list1):\n lenght=len(list1)\n round_and_sum=sum(list(map(round,list1))* lenght)\n return round_and_sum",
"test_imports": [],
"test_list": [
"assert round_and_sum([22.4, 4.0, -16.22, -9.10, 11.00, -12.22, 14.20, -5.20, 17.50])==243",
"assert round_and_sum([5,2,9,24.3,29])==345",
"assert round_and_sum([25.0,56.7,89.2])==513"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"22.4 4.0 -16.22 -9.1 11.0 -12.22 14.2 -5.2 17.5\n",
"5 2 9 24.3 29\n",
"25.0 56.7 89.2\n"
],
"test_output": [
"243\n",
"345\n",
"513\n"
],
"example_input": [
"22.4 4.0 -16.22 -9.1 11.0 -12.22 14.2 -5.2 17.5\n",
"5 2 9 24.3 29\n"
],
"example_output": [
"243\n",
"345\n"
],
"question": "Original problem description:\nWrite a function to round every number of a given list of numbers and print the total sum multiplied by the length of the list.\nWe have its functional test sample:\nassert round_and_sum([22.4, 4.0, -16.22, -9.10, 11.00, -12.22, 14.20, -5.20, 17.50])==243\nassert round_and_sum([5,2,9,24.3,29])==345\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n22.4 4.0 -16.22 -9.1 11.0 -12.22 14.2 -5.2 17.5\n\nOutput:\n243\n\n\nExample 2:\nInput:\n5 2 9 24.3 29\n\nOutput:\n345\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 202,
"prompt": "Write a python function to find the cube sum of first n even natural numbers.",
"code": "def cube_Sum(n): \n sum = 0\n for i in range(1,n + 1): \n sum += (2*i)*(2*i)*(2*i) \n return sum",
"test_imports": [],
"test_list": [
"assert cube_Sum(2) == 72",
"assert cube_Sum(3) == 288",
"assert cube_Sum(4) == 800"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n",
"3\n",
"4\n"
],
"test_output": [
"72\n",
"288\n",
"800\n"
],
"example_input": [
"2\n",
"3\n"
],
"example_output": [
"72\n",
"288\n"
],
"question": "Original problem description:\nWrite a python function to find the cube sum of first n even natural numbers.\nWe have its functional test sample:\nassert cube_Sum(2) == 72\nassert cube_Sum(3) == 288\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n\nOutput:\n72\n\n\nExample 2:\nInput:\n3\n\nOutput:\n288\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 203,
"prompt": "Write a function to concatenate each element of tuple by the delimiter.",
"code": "def concatenate_tuple(test_tup):\n delim = \"-\"\n res = ''.join([str(ele) + delim for ele in test_tup])\n res = res[ : len(res) - len(delim)]\n return (str(res)) ",
"test_imports": [],
"test_list": [
"assert concatenate_tuple((\"ID\", \"is\", 4, \"UTS\") ) == 'ID-is-4-UTS'",
"assert concatenate_tuple((\"QWE\", \"is\", 4, \"RTY\") ) == 'QWE-is-4-RTY'",
"assert concatenate_tuple((\"ZEN\", \"is\", 4, \"OP\") ) == 'ZEN-is-4-OP'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"ID\nis\n4\nUTS\n",
"QWE\nis\n4\nRTY\n",
"ZEN\nis\n4\nOP\n"
],
"test_output": [
"ID-is-4-UTS\n",
"QWE-is-4-RTY\n",
"ZEN-is-4-OP\n"
],
"example_input": [
"ID\nis\n4\nUTS\n",
"QWE\nis\n4\nRTY\n"
],
"example_output": [
"ID-is-4-UTS\n",
"QWE-is-4-RTY\n"
],
"question": "Original problem description:\nWrite a function to concatenate each element of tuple by the delimiter.\nWe have its functional test sample:\nassert concatenate_tuple((\"ID\", \"is\", 4, \"UTS\") ) == 'ID-is-4-UTS'\nassert concatenate_tuple((\"QWE\", \"is\", 4, \"RTY\") ) == 'QWE-is-4-RTY'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nID\nis\n4\nUTS\n\nOutput:\nID-is-4-UTS\n\n\nExample 2:\nInput:\nQWE\nis\n4\nRTY\n\nOutput:\nQWE-is-4-RTY\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 204,
"prompt": "Write a python function to find the average of cubes of first n natural numbers.",
"code": "def find_Average_Of_Cube(n): \n sum = 0\n for i in range(1, n + 1): \n sum += i * i * i \n return round(sum / n, 6) ",
"test_imports": [],
"test_list": [
"assert find_Average_Of_Cube(2) == 4.5",
"assert find_Average_Of_Cube(3) == 12",
"assert find_Average_Of_Cube(1) == 1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2\n",
"3\n",
"1\n"
],
"test_output": [
"4.5\n",
"12\n",
"1\n"
],
"example_input": [
"2\n",
"3\n"
],
"example_output": [
"4.5\n",
"12\n"
],
"question": "Original problem description:\nWrite a python function to find the average of cubes of first n natural numbers.\nWe have its functional test sample:\nassert find_Average_Of_Cube(2) == 4.5\nassert find_Average_Of_Cube(3) == 12\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2\n\nOutput:\n4.5\n\n\nExample 2:\nInput:\n3\n\nOutput:\n12\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 205,
"prompt": "Write a function to extract only the rear index element of each string in the given tuple.",
"code": "def extract_rear(test_tuple):\n res = list(sub[len(sub) - 1] for sub in test_tuple)\n return (res) ",
"test_imports": [],
"test_list": [
"assert extract_rear(('Mers', 'for', 'Vers') ) == ['s', 'r', 's']",
"assert extract_rear(('Avenge', 'for', 'People') ) == ['e', 'r', 'e']",
"assert extract_rear(('Gotta', 'get', 'go') ) == ['a', 't', 'o']"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Mers\nfor\nVers\n",
"Avenge\nfor\nPeople\n",
"Gotta\nget\ngo\n"
],
"test_output": [
"s r s\n",
"e r e\n",
"a t o\n"
],
"example_input": [
"Mers\nfor\nVers\n",
"Avenge\nfor\nPeople\n"
],
"example_output": [
"s r s\n",
"e r e\n"
],
"question": "Original problem description:\nWrite a function to extract only the rear index element of each string in the given tuple.\nWe have its functional test sample:\nassert extract_rear(('Mers', 'for', 'Vers') ) == ['s', 'r', 's']\nassert extract_rear(('Avenge', 'for', 'People') ) == ['e', 'r', 'e']\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nMers\nfor\nVers\n\nOutput:\ns r s\n\n\nExample 2:\nInput:\nAvenge\nfor\nPeople\n\nOutput:\ne r e\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 207,
"prompt": "Write a function to filter odd numbers.",
"code": "def filter_oddnumbers(nums):\n odd_nums = list(filter(lambda x: x%2 != 0, nums))\n return odd_nums",
"test_imports": [],
"test_list": [
"assert filter_oddnumbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1,3,5,7,9]",
"assert filter_oddnumbers([10,20,45,67,84,93])==[45,67,93]",
"assert filter_oddnumbers([5,7,9,8,6,4,3])==[5,7,9,3]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5 6 7 8 9 10\n",
"10 20 45 67 84 93\n",
"5 7 9 8 6 4 3\n"
],
"test_output": [
"1 3 5 7 9\n",
"45 67 93\n",
"5 7 9 3\n"
],
"example_input": [
"1 2 3 4 5 6 7 8 9 10\n",
"10 20 45 67 84 93\n"
],
"example_output": [
"1 3 5 7 9\n",
"45 67 93\n"
],
"question": "Original problem description:\nWrite a function to filter odd numbers.\nWe have its functional test sample:\nassert filter_oddnumbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1,3,5,7,9]\nassert filter_oddnumbers([10,20,45,67,84,93])==[45,67,93]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5 6 7 8 9 10\n\nOutput:\n1 3 5 7 9\n\n\nExample 2:\nInput:\n10 20 45 67 84 93\n\nOutput:\n45 67 93\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 208,
"prompt": "Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format.",
"code": "import re\ndef change_date_format(dt):\n return re.sub(r'(\\d{4})-(\\d{1,2})-(\\d{1,2})', '\\\\3-\\\\2-\\\\1', dt)",
"test_imports": [],
"test_list": [
"assert change_date_format(\"2026-01-02\") == '02-01-2026'",
"assert change_date_format(\"2020-11-13\") == '13-11-2020'",
"assert change_date_format(\"2021-04-26\") == '26-04-2021'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"2026-01-02\n",
"2020-11-13\n",
"2021-04-26\n"
],
"test_output": [
"02-01-2026\n",
"13-11-2020\n",
"26-04-2021\n"
],
"example_input": [
"2026-01-02\n",
"2020-11-13\n"
],
"example_output": [
"02-01-2026\n",
"13-11-2020\n"
],
"question": "Original problem description:\nWrite a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format.\nWe have its functional test sample:\nassert change_date_format(\"2026-01-02\") == '02-01-2026'\nassert change_date_format(\"2020-11-13\") == '13-11-2020'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n2026-01-02\n\nOutput:\n02-01-2026\n\n\nExample 2:\nInput:\n2020-11-13\n\nOutput:\n13-11-2020\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 209,
"prompt": "Write a function to sort the given array by using shell sort.",
"code": "def shell_sort(my_list):\n gap = len(my_list) // 2\n while gap > 0:\n for i in range(gap, len(my_list)):\n current_item = my_list[i]\n j = i\n while j >= gap and my_list[j - gap] > current_item:\n my_list[j] = my_list[j - gap]\n j -= gap\n my_list[j] = current_item\n gap //= 2\n\n return my_list",
"test_imports": [],
"test_list": [
"assert shell_sort([12, 23, 4, 5, 3, 2, 12, 81, 56, 95]) == [2, 3, 4, 5, 12, 12, 23, 56, 81, 95]",
"assert shell_sort([24, 22, 39, 34, 87, 73, 68]) == [22, 24, 34, 39, 68, 73, 87]",
"assert shell_sort([32, 30, 16, 96, 82, 83, 74]) == [16, 30, 32, 74, 82, 83, 96]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"12 23 4 5 3 2 12 81 56 95\n",
"24 22 39 34 87 73 68\n",
"32 30 16 96 82 83 74\n"
],
"test_output": [
"2 3 4 5 12 12 23 56 81 95\n",
"22 24 34 39 68 73 87\n",
"16 30 32 74 82 83 96\n"
],
"example_input": [
"12 23 4 5 3 2 12 81 56 95\n",
"24 22 39 34 87 73 68\n"
],
"example_output": [
"2 3 4 5 12 12 23 56 81 95\n",
"22 24 34 39 68 73 87\n"
],
"question": "Original problem description:\nWrite a function to sort the given array by using shell sort.\nWe have its functional test sample:\nassert shell_sort([12, 23, 4, 5, 3, 2, 12, 81, 56, 95]) == [2, 3, 4, 5, 12, 12, 23, 56, 81, 95]\nassert shell_sort([24, 22, 39, 34, 87, 73, 68]) == [22, 24, 34, 39, 68, 73, 87]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n12 23 4 5 3 2 12 81 56 95\n\nOutput:\n2 3 4 5 12 12 23 56 81 95\n\n\nExample 2:\nInput:\n24 22 39 34 87 73 68\n\nOutput:\n22 24 34 39 68 73 87\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 210,
"prompt": "Write a function to extract the elementwise and tuples from the given two tuples.",
"code": "def and_tuples(test_tup1, test_tup2):\n res = tuple(ele1 & ele2 for ele1, ele2 in zip(test_tup1, test_tup2))\n return (res) ",
"test_imports": [],
"test_list": [
"assert and_tuples((10, 4, 6, 9), (5, 2, 3, 3)) == (0, 0, 2, 1)",
"assert and_tuples((1, 2, 3, 4), (5, 6, 7, 8)) == (1, 2, 3, 0)",
"assert and_tuples((8, 9, 11, 12), (7, 13, 14, 17)) == (0, 9, 10, 0)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10 4 6 9\n5 2 3 3\n",
"1 2 3 4\n5 6 7 8\n",
"8 9 11 12\n7 13 14 17\n"
],
"test_output": [
"0 0 2 1\n",
"1 2 3 0\n",
"0 9 10 0\n"
],
"example_input": [
"10 4 6 9\n5 2 3 3\n",
"1 2 3 4\n5 6 7 8\n"
],
"example_output": [
"0 0 2 1\n",
"1 2 3 0\n"
],
"question": "Original problem description:\nWrite a function to extract the elementwise and tuples from the given two tuples.\nWe have its functional test sample:\nassert and_tuples((10, 4, 6, 9), (5, 2, 3, 3)) == (0, 0, 2, 1)\nassert and_tuples((1, 2, 3, 4), (5, 6, 7, 8)) == (1, 2, 3, 0)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10 4 6 9\n5 2 3 3\n\nOutput:\n0 0 2 1\n\n\nExample 2:\nInput:\n1 2 3 4\n5 6 7 8\n\nOutput:\n1 2 3 0\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 211,
"prompt": "Write a function to find the directrix of a parabola.",
"code": "def parabola_directrix(a, b, c): \n directrix=((int)(c - ((b * b) + 1) * 4 * a ))\n return directrix",
"test_imports": [],
"test_list": [
"assert parabola_directrix(5,3,2)==-198",
"assert parabola_directrix(9,8,4)==-2336",
"assert parabola_directrix(2,4,6)==-130"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n3\n2\n",
"9\n8\n4\n",
"2\n4\n6\n"
],
"test_output": [
"-198\n",
"-2336\n",
"-130\n"
],
"example_input": [
"5\n3\n2\n",
"9\n8\n4\n"
],
"example_output": [
"-198\n",
"-2336\n"
],
"question": "Original problem description:\nWrite a function to find the directrix of a parabola.\nWe have its functional test sample:\nassert parabola_directrix(5,3,2)==-198\nassert parabola_directrix(9,8,4)==-2336\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n3\n2\n\nOutput:\n-198\n\n\nExample 2:\nInput:\n9\n8\n4\n\nOutput:\n-2336\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 212,
"prompt": "Write a function that takes two lists and returns true if they have at least one common element.",
"code": "def common_element(list1, list2):\n result = False\n for x in list1:\n for y in list2:\n if x == y:\n result = True\n return result",
"test_imports": [],
"test_list": [
"assert common_element([1,2,3,4,5], [5,6,7,8,9])==True",
"assert common_element([1,2,3,4,5], [6,7,8,9])==None",
"assert common_element(['a','b','c'], ['d','b','e'])==True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5\n5 6 7 8 9\n",
"1 2 3 4 5\n6 7 8 9\n",
"a b c\nd b e\n"
],
"test_output": [
"True\n",
"None\n",
"True\n"
],
"example_input": [
"1 2 3 4 5\n5 6 7 8 9\n",
"1 2 3 4 5\n6 7 8 9\n"
],
"example_output": [
"True\n",
"None\n"
],
"question": "Original problem description:\nWrite a function that takes two lists and returns true if they have at least one common element.\nWe have its functional test sample:\nassert common_element([1,2,3,4,5], [5,6,7,8,9])==True\nassert common_element([1,2,3,4,5], [6,7,8,9])==None\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5\n5 6 7 8 9\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n1 2 3 4 5\n6 7 8 9\n\nOutput:\nNone\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 213,
"prompt": "Write a function to find the median length of a trapezium.",
"code": "def median_trapezium(base1,base2,height):\n median = 0.5 * (base1+ base2)\n return median",
"test_imports": [],
"test_list": [
"assert median_trapezium(15,25,35)==20",
"assert median_trapezium(10,20,30)==15",
"assert median_trapezium(6,9,4)==7.5"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"15\n25\n35\n",
"10\n20\n30\n",
"6\n9\n4\n"
],
"test_output": [
"20\n",
"15\n",
"7.5\n"
],
"example_input": [
"15\n25\n35\n",
"10\n20\n30\n"
],
"example_output": [
"20\n",
"15\n"
],
"question": "Original problem description:\nWrite a function to find the median length of a trapezium.\nWe have its functional test sample:\nassert median_trapezium(15,25,35)==20\nassert median_trapezium(10,20,30)==15\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n15\n25\n35\n\nOutput:\n20\n\n\nExample 2:\nInput:\n10\n20\n30\n\nOutput:\n15\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 214,
"prompt": "Write a function to check whether the entered number is greater than the elements of the given array.",
"code": "def check_greater(arr, number):\n arr.sort()\n return number > arr[-1]",
"test_imports": [],
"test_list": [
"assert check_greater([1, 2, 3, 4, 5], 4) == False",
"assert check_greater([2, 3, 4, 5, 6], 8) == True",
"assert check_greater([9, 7, 4, 8, 6, 1], 11) == True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5\n4\n",
"2 3 4 5 6\n8\n",
"9 7 4 8 6 1\n11\n"
],
"test_output": [
"False\n",
"True\n",
"True\n"
],
"example_input": [
"1 2 3 4 5\n4\n",
"2 3 4 5 6\n8\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a function to check whether the entered number is greater than the elements of the given array.\nWe have its functional test sample:\nassert check_greater([1, 2, 3, 4, 5], 4) == False\nassert check_greater([2, 3, 4, 5, 6], 8) == True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5\n4\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n2 3 4 5 6\n8\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 215,
"prompt": "Write a function that matches a string that has an a followed by one or more b's.",
"code": "import re\ndef text_match_one(text):\n patterns = 'ab+?'\n if re.search(patterns, text):\n return True\n else:\n return False\n",
"test_imports": [],
"test_list": [
"assert text_match_one(\"ac\")==False",
"assert text_match_one(\"dc\")==False",
"assert text_match_one(\"abba\")==True"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"ac\n",
"dc\n",
"abba\n"
],
"test_output": [
"False\n",
"False\n",
"True\n"
],
"example_input": [
"ac\n",
"dc\n"
],
"example_output": [
"False\n",
"False\n"
],
"question": "Original problem description:\nWrite a function that matches a string that has an a followed by one or more b's.\nWe have its functional test sample:\nassert text_match_one(\"ac\")==False\nassert text_match_one(\"dc\")==False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nac\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\ndc\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 216,
"prompt": "Write a python function to find the last digit of a given number.",
"code": "def last_Digit(n) :\n return (n % 10) ",
"test_imports": [],
"test_list": [
"assert last_Digit(123) == 3",
"assert last_Digit(25) == 5",
"assert last_Digit(30) == 0"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"123\n",
"25\n",
"30\n"
],
"test_output": [
"3\n",
"5\n",
"0\n"
],
"example_input": [
"123\n",
"25\n"
],
"example_output": [
"3\n",
"5\n"
],
"question": "Original problem description:\nWrite a python function to find the last digit of a given number.\nWe have its functional test sample:\nassert last_Digit(123) == 3\nassert last_Digit(25) == 5\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n123\n\nOutput:\n3\n\n\nExample 2:\nInput:\n25\n\nOutput:\n5\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 217,
"prompt": "Write a python function to return the negative numbers in a list.",
"code": "def neg_nos(list1):\n out = []\n for num in list1: \n if num < 0: \n out.append(num)\n return out ",
"test_imports": [],
"test_list": [
"assert neg_nos([-1,4,5,-6]) == [-1,-6]",
"assert neg_nos([-1,-2,3,4]) == [-1,-2]",
"assert neg_nos([-7,-6,8,9]) == [-7,-6]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"-1 4 5 -6\n",
"-1 -2 3 4\n",
"-7 -6 8 9\n"
],
"test_output": [
"-1 -6\n",
"-1 -2\n",
"-7 -6\n"
],
"example_input": [
"-1 4 5 -6\n",
"-1 -2 3 4\n"
],
"example_output": [
"-1 -6\n",
"-1 -2\n"
],
"question": "Original problem description:\nWrite a python function to return the negative numbers in a list.\nWe have its functional test sample:\nassert neg_nos([-1,4,5,-6]) == [-1,-6]\nassert neg_nos([-1,-2,3,4]) == [-1,-2]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n-1 4 5 -6\n\nOutput:\n-1 -6\n\n\nExample 2:\nInput:\n-1 -2 3 4\n\nOutput:\n-1 -2\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 218,
"prompt": "Write a function to remove odd characters in a string.",
"code": "def remove_odd(str1):\n str2 = ''\n for i in range(1, len(str1) + 1):\n if(i % 2 == 0):\n str2 = str2 + str1[i - 1]\n return str2",
"test_imports": [],
"test_list": [
"assert remove_odd(\"python\")==(\"yhn\")",
"assert remove_odd(\"program\")==(\"rga\")",
"assert remove_odd(\"language\")==(\"agae\")"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"python\n",
"program\n",
"language\n"
],
"test_output": [
"yhn\n",
"rga\n",
"agae\n"
],
"example_input": [
"python\n",
"program\n"
],
"example_output": [
"yhn\n",
"rga\n"
],
"question": "Original problem description:\nWrite a function to remove odd characters in a string.\nWe have its functional test sample:\nassert remove_odd(\"python\")==(\"yhn\")\nassert remove_odd(\"program\")==(\"rga\")\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npython\n\nOutput:\nyhn\n\n\nExample 2:\nInput:\nprogram\n\nOutput:\nrga\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 219,
"prompt": "Write a function to count bidirectional tuple pairs.",
"code": "def count_bidirectional(test_list):\n res = 0\n for idx in range(0, len(test_list)):\n for iidx in range(idx + 1, len(test_list)):\n if test_list[iidx][0] == test_list[idx][1] and test_list[idx][1] == test_list[iidx][0]:\n res += 1\n return res",
"test_imports": [],
"test_list": [
"assert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 1), (6, 5), (2, 1)] ) == 3",
"assert count_bidirectional([(5, 6), (1, 3), (6, 5), (9, 1), (6, 5), (2, 1)] ) == 2",
"assert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 2), (6, 5), (2, 1)] ) == 4"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5 6\n1 2\n6 5\n9 1\n6 5\n2 1\n",
"5 6\n1 3\n6 5\n9 1\n6 5\n2 1\n",
"5 6\n1 2\n6 5\n9 2\n6 5\n2 1\n"
],
"test_output": [
"3\n",
"2\n",
"4\n"
],
"example_input": [
"5 6\n1 2\n6 5\n9 1\n6 5\n2 1\n",
"5 6\n1 3\n6 5\n9 1\n6 5\n2 1\n"
],
"example_output": [
"3\n",
"2\n"
],
"question": "Original problem description:\nWrite a function to count bidirectional tuple pairs.\nWe have its functional test sample:\nassert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 1), (6, 5), (2, 1)] ) == 3\nassert count_bidirectional([(5, 6), (1, 3), (6, 5), (9, 1), (6, 5), (2, 1)] ) == 2\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5 6\n1 2\n6 5\n9 1\n6 5\n2 1\n\nOutput:\n3\n\n\nExample 2:\nInput:\n5 6\n1 3\n6 5\n9 1\n6 5\n2 1\n\nOutput:\n2\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 220,
"prompt": "Write a function to join a list of multiple integers into a single integer.",
"code": "def multiple_to_single(L):\n x = int(\"\".join(map(str, L)))\n return x",
"test_imports": [],
"test_list": [
"assert multiple_to_single([11, 33, 50])==113350",
"assert multiple_to_single([-1,2,3,4,5,6])==-123456",
"assert multiple_to_single([10,15,20,25])==10152025"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"11 33 50\n",
"-1 2 3 4 5 6\n",
"10 15 20 25\n"
],
"test_output": [
"113350\n",
"-123456\n",
"10152025\n"
],
"example_input": [
"11 33 50\n",
"-1 2 3 4 5 6\n"
],
"example_output": [
"113350\n",
"-123456\n"
],
"question": "Original problem description:\nWrite a function to join a list of multiple integers into a single integer.\nWe have its functional test sample:\nassert multiple_to_single([11, 33, 50])==113350\nassert multiple_to_single([-1,2,3,4,5,6])==-123456\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n11 33 50\n\nOutput:\n113350\n\n\nExample 2:\nInput:\n-1 2 3 4 5 6\n\nOutput:\n-123456\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 221,
"prompt": "Write a function to find the first adverb and their positions in a given sentence.",
"code": "import re\ndef find_adverb_position(text):\n for m in re.finditer(r\"\\w+ly\", text):\n return (m.start(), m.end(), m.group(0))",
"test_imports": [],
"test_list": [
"assert find_adverb_position(\"clearly!! we can see the sky\")==(0, 7, 'clearly')",
"assert find_adverb_position(\"seriously!! there are many roses\")==(0, 9, 'seriously')",
"assert find_adverb_position(\"unfortunately!! sita is going to home\")==(0, 13, 'unfortunately')"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"clearly!! we can see the sky\n",
"seriously!! there are many roses\n",
"unfortunately!! sita is going to home\n"
],
"test_output": [
"0 7 clearly\n",
"0 9 seriously\n",
"0 13 unfortunately\n"
],
"example_input": [
"clearly!! we can see the sky\n",
"seriously!! there are many roses\n"
],
"example_output": [
"0 7 clearly\n",
"0 9 seriously\n"
],
"question": "Original problem description:\nWrite a function to find the first adverb and their positions in a given sentence.\nWe have its functional test sample:\nassert find_adverb_position(\"clearly!! we can see the sky\")==(0, 7, 'clearly')\nassert find_adverb_position(\"seriously!! there are many roses\")==(0, 9, 'seriously')\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nclearly!! we can see the sky\n\nOutput:\n0 7 clearly\n\n\nExample 2:\nInput:\nseriously!! there are many roses\n\nOutput:\n0 9 seriously\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 222,
"prompt": "Write a function to find the surface area of a cube of a given size.",
"code": "def surfacearea_cube(l):\n surfacearea= 6*l*l\n return surfacearea",
"test_imports": [],
"test_list": [
"assert surfacearea_cube(5)==150",
"assert surfacearea_cube(3)==54",
"assert surfacearea_cube(10)==600"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n",
"3\n",
"10\n"
],
"test_output": [
"150\n",
"54\n",
"600\n"
],
"example_input": [
"5\n",
"3\n"
],
"example_output": [
"150\n",
"54\n"
],
"question": "Original problem description:\nWrite a function to find the surface area of a cube of a given size.\nWe have its functional test sample:\nassert surfacearea_cube(5)==150\nassert surfacearea_cube(3)==54\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n\nOutput:\n150\n\n\nExample 2:\nInput:\n3\n\nOutput:\n54\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 223,
"prompt": "Write a function to find the ration of positive numbers in an array of integers.",
"code": "from array import array\ndef positive_count(nums):\n n = len(nums)\n n1 = 0\n for x in nums:\n if x > 0:\n n1 += 1\n else:\n None\n return round(n1/n,2)",
"test_imports": [],
"test_list": [
"assert positive_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.54",
"assert positive_count([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8])==0.69",
"assert positive_count([2, 4, -6, -9, 11, -12, 14, -5, 17])==0.56"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"0 1 2 -1 -5 6 0 -3 -2 3 4 6 8\n",
"2 1 2 -1 -5 6 4 -3 -2 3 4 6 8\n",
"2 4 -6 -9 11 -12 14 -5 17\n"
],
"test_output": [
"0.54\n",
"0.69\n",
"0.56\n"
],
"example_input": [
"0 1 2 -1 -5 6 0 -3 -2 3 4 6 8\n",
"2 1 2 -1 -5 6 4 -3 -2 3 4 6 8\n"
],
"example_output": [
"0.54\n",
"0.69\n"
],
"question": "Original problem description:\nWrite a function to find the ration of positive numbers in an array of integers.\nWe have its functional test sample:\nassert positive_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.54\nassert positive_count([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8])==0.69\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n0 1 2 -1 -5 6 0 -3 -2 3 4 6 8\n\nOutput:\n0.54\n\n\nExample 2:\nInput:\n2 1 2 -1 -5 6 4 -3 -2 3 4 6 8\n\nOutput:\n0.69\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 224,
"prompt": "Write a python function to find the largest negative number from the given list.",
"code": "def largest_neg(list1): \n max = list1[0] \n for x in list1: \n if x < max : \n max = x \n return max",
"test_imports": [],
"test_list": [
"assert largest_neg([1,2,3,-4,-6]) == -6",
"assert largest_neg([1,2,3,-8,-9]) == -9",
"assert largest_neg([1,2,3,4,-1]) == -1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 -4 -6\n",
"1 2 3 -8 -9\n",
"1 2 3 4 -1\n"
],
"test_output": [
"-6\n",
"-9\n",
"-1\n"
],
"example_input": [
"1 2 3 -4 -6\n",
"1 2 3 -8 -9\n"
],
"example_output": [
"-6\n",
"-9\n"
],
"question": "Original problem description:\nWrite a python function to find the largest negative number from the given list.\nWe have its functional test sample:\nassert largest_neg([1,2,3,-4,-6]) == -6\nassert largest_neg([1,2,3,-8,-9]) == -9\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 -4 -6\n\nOutput:\n-6\n\n\nExample 2:\nInput:\n1 2 3 -8 -9\n\nOutput:\n-9\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 227,
"prompt": "Write a python function to count the occurence of all elements of list in a tuple.",
"code": "from collections import Counter \ndef count_Occurrence(tup, lst): \n count = 0\n for item in tup: \n if item in lst: \n count+= 1 \n return count ",
"test_imports": [],
"test_list": [
"assert count_Occurrence(('a', 'a', 'c', 'b', 'd'),['a', 'b'] ) == 3",
"assert count_Occurrence((1, 2, 3, 1, 4, 6, 7, 1, 4),[1, 4, 7]) == 6",
"assert count_Occurrence((1,2,3,4,5,6),[1,2]) == 2"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"a a c b d\na b\n",
"1 2 3 1 4 6 7 1 4\n1 4 7\n",
"1 2 3 4 5 6\n1 2\n"
],
"test_output": [
"3\n",
"6\n",
"2\n"
],
"example_input": [
"a a c b d\na b\n",
"1 2 3 1 4 6 7 1 4\n1 4 7\n"
],
"example_output": [
"3\n",
"6\n"
],
"question": "Original problem description:\nWrite a python function to count the occurence of all elements of list in a tuple.\nWe have its functional test sample:\nassert count_Occurrence(('a', 'a', 'c', 'b', 'd'),['a', 'b'] ) == 3\nassert count_Occurrence((1, 2, 3, 1, 4, 6, 7, 1, 4),[1, 4, 7]) == 6\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\na a c b d\na b\n\nOutput:\n3\n\n\nExample 2:\nInput:\n1 2 3 1 4 6 7 1 4\n1 4 7\n\nOutput:\n6\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 228,
"prompt": "Write a function to find cubes of individual elements in a list.",
"code": "def cube_nums(nums):\n cube_nums = list(map(lambda x: x ** 3, nums))\n return cube_nums",
"test_imports": [],
"test_list": [
"assert cube_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]",
"assert cube_nums([10,20,30])==([1000, 8000, 27000])",
"assert cube_nums([12,15])==([1728, 3375])"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5 6 7 8 9 10\n",
"10 20 30\n",
"12 15\n"
],
"test_output": [
"1 8 27 64 125 216 343 512 729 1000\n",
"1000 8000 27000\n",
"1728 3375\n"
],
"example_input": [
"1 2 3 4 5 6 7 8 9 10\n",
"10 20 30\n"
],
"example_output": [
"1 8 27 64 125 216 343 512 729 1000\n",
"1000 8000 27000\n"
],
"question": "Original problem description:\nWrite a function to find cubes of individual elements in a list.\nWe have its functional test sample:\nassert cube_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]\nassert cube_nums([10,20,30])==([1000, 8000, 27000])\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5 6 7 8 9 10\n\nOutput:\n1 8 27 64 125 216 343 512 729 1000\n\n\nExample 2:\nInput:\n10 20 30\n\nOutput:\n1000 8000 27000\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 229,
"prompt": "Write a function to calculate the sum of perrin numbers.",
"code": "def cal_sum(n): \n\ta = 3\n\tb = 0\n\tc = 2\n\tif (n == 0): \n\t\treturn 3\n\tif (n == 1): \n\t\treturn 3\n\tif (n == 2): \n\t\treturn 5\n\tsum = 5\n\twhile (n > 2): \n\t\td = a + b \n\t\tsum = sum + d \n\t\ta = b \n\t\tb = c \n\t\tc = d \n\t\tn = n-1\n\treturn sum",
"test_imports": [],
"test_list": [
"assert cal_sum(9) == 49",
"assert cal_sum(10) == 66",
"assert cal_sum(11) == 88"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"9\n",
"10\n",
"11\n"
],
"test_output": [
"49\n",
"66\n",
"88\n"
],
"example_input": [
"9\n",
"10\n"
],
"example_output": [
"49\n",
"66\n"
],
"question": "Original problem description:\nWrite a function to calculate the sum of perrin numbers.\nWe have its functional test sample:\nassert cal_sum(9) == 49\nassert cal_sum(10) == 66\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n9\n\nOutput:\n49\n\n\nExample 2:\nInput:\n10\n\nOutput:\n66\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 230,
"prompt": "Write a function to extract specified size of strings from a given list of string values.",
"code": "def extract_string(str, l):\n result = [e for e in str if len(e) == l] \n return result",
"test_imports": [],
"test_list": [
"assert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,8)==['practice', 'solution']",
"assert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,6)==['Python']",
"assert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,9)==['exercises']"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Python list exercises practice solution\n8\n",
"Python list exercises practice solution\n6\n",
"Python list exercises practice solution\n9\n"
],
"test_output": [
"practice solution\n",
"Python\n",
"exercises\n"
],
"example_input": [
"Python list exercises practice solution\n8\n",
"Python list exercises practice solution\n6\n"
],
"example_output": [
"practice solution\n",
"Python\n"
],
"question": "Original problem description:\nWrite a function to extract specified size of strings from a given list of string values.\nWe have its functional test sample:\nassert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,8)==['practice', 'solution']\nassert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,6)==['Python']\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nPython list exercises practice solution\n8\n\nOutput:\npractice solution\n\n\nExample 2:\nInput:\nPython list exercises practice solution\n6\n\nOutput:\nPython\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 231,
"prompt": "Write a function to remove all whitespaces from the given string.",
"code": "import re\ndef remove_whitespaces(text1):\n return (re.sub(r'\\s+', '',text1))",
"test_imports": [],
"test_list": [
"assert remove_whitespaces(' Google Flutter ') == 'GoogleFlutter'",
"assert remove_whitespaces(' Google Dart ') == 'GoogleDart'",
"assert remove_whitespaces(' iOS Swift ') == 'iOSSwift'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Google Flutter\n",
"Google Dart\n",
"iOS Swift\n"
],
"test_output": [
"GoogleFlutter\n",
"GoogleDart\n",
"iOSSwift\n"
],
"example_input": [
"Google Flutter\n",
"Google Dart\n"
],
"example_output": [
"GoogleFlutter\n",
"GoogleDart\n"
],
"question": "Original problem description:\nWrite a function to remove all whitespaces from the given string.\nWe have its functional test sample:\nassert remove_whitespaces(' Google Flutter ') == 'GoogleFlutter'\nassert remove_whitespaces(' Google Dart ') == 'GoogleDart'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nGoogle Flutter\n\nOutput:\nGoogleFlutter\n\n\nExample 2:\nInput:\nGoogle Dart\n\nOutput:\nGoogleDart\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 232,
"prompt": "Write a function that gives loss amount on a sale if the given amount has loss else return 0.",
"code": "def loss_amount(actual_cost,sale_amount): \n if(sale_amount > actual_cost):\n amount = sale_amount - actual_cost\n return amount\n else:\n return 0",
"test_imports": [],
"test_list": [
"assert loss_amount(1500,1200)==0",
"assert loss_amount(100,200)==100",
"assert loss_amount(2000,5000)==3000"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1500\n1200\n",
"100\n200\n",
"2000\n5000\n"
],
"test_output": [
"0\n",
"100\n",
"3000\n"
],
"example_input": [
"1500\n1200\n",
"100\n200\n"
],
"example_output": [
"0\n",
"100\n"
],
"question": "Original problem description:\nWrite a function that gives loss amount on a sale if the given amount has loss else return 0.\nWe have its functional test sample:\nassert loss_amount(1500,1200)==0\nassert loss_amount(100,200)==100\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1500\n1200\n\nOutput:\n0\n\n\nExample 2:\nInput:\n100\n200\n\nOutput:\n100\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 233,
"prompt": "Write a python function to find the sum of even factors of a number.",
"code": "import math \ndef sumofFactors(n) : \n if (n % 2 != 0) : \n return 0\n res = 1\n for i in range(2, (int)(math.sqrt(n)) + 1) : \n count = 0\n curr_sum = 1\n curr_term = 1\n while (n % i == 0) : \n count= count + 1\n n = n // i \n if (i == 2 and count == 1) : \n curr_sum = 0\n curr_term = curr_term * i \n curr_sum = curr_sum + curr_term \n res = res * curr_sum \n if (n >= 2) : \n res = res * (1 + n) \n return res",
"test_imports": [],
"test_list": [
"assert sumofFactors(18) == 26",
"assert sumofFactors(30) == 48",
"assert sumofFactors(6) == 8"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"18\n",
"30\n",
"6\n"
],
"test_output": [
"26\n",
"48\n",
"8\n"
],
"example_input": [
"18\n",
"30\n"
],
"example_output": [
"26\n",
"48\n"
],
"question": "Original problem description:\nWrite a python function to find the sum of even factors of a number.\nWe have its functional test sample:\nassert sumofFactors(18) == 26\nassert sumofFactors(30) == 48\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n18\n\nOutput:\n26\n\n\nExample 2:\nInput:\n30\n\nOutput:\n48\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 234,
"prompt": "Write a function that matches a word containing 'z'.",
"code": "import re\ndef text_match_wordz(text):\n patterns = '\\w*z.\\w*'\n if re.search(patterns, text):\n return True\n else:\n return False",
"test_imports": [],
"test_list": [
"assert text_match_wordz(\"pythonz.\")==True",
"assert text_match_wordz(\"xyz.\")==True",
"assert text_match_wordz(\" lang .\")==False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"pythonz.\n",
"xyz.\n",
"lang .\n"
],
"test_output": [
"True\n",
"True\n",
"False\n"
],
"example_input": [
"pythonz.\n",
"xyz.\n"
],
"example_output": [
"True\n",
"True\n"
],
"question": "Original problem description:\nWrite a function that matches a word containing 'z'.\nWe have its functional test sample:\nassert text_match_wordz(\"pythonz.\")==True\nassert text_match_wordz(\"xyz.\")==True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npythonz.\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\nxyz.\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 235,
"prompt": "Write a function to check whether the given month number contains 31 days or not.",
"code": "def check_monthnumb_number(monthnum2):\n if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12):\n return True\n else:\n return False",
"test_imports": [],
"test_list": [
"assert check_monthnumb_number(5)==True",
"assert check_monthnumb_number(2)==False",
"assert check_monthnumb_number(6)==False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"5\n",
"2\n",
"6\n"
],
"test_output": [
"True\n",
"False\n",
"False\n"
],
"example_input": [
"5\n",
"2\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a function to check whether the given month number contains 31 days or not.\nWe have its functional test sample:\nassert check_monthnumb_number(5)==True\nassert check_monthnumb_number(2)==False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n5\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n2\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 236,
"prompt": "Write a function to reverse each string in a given list of string values.",
"code": "def reverse_string_list(stringlist):\n result = [x[::-1] for x in stringlist]\n return result",
"test_imports": [],
"test_list": [
"assert reverse_string_list(['Red', 'Green', 'Blue', 'White', 'Black'])==['deR', 'neerG', 'eulB', 'etihW', 'kcalB']",
"assert reverse_string_list(['john','amal','joel','george'])==['nhoj','lama','leoj','egroeg']",
"assert reverse_string_list(['jack','john','mary'])==['kcaj','nhoj','yram']"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"Red Green Blue White Black\n",
"john amal joel george\n",
"jack john mary\n"
],
"test_output": [
"deR neerG eulB etihW kcalB\n",
"nhoj lama leoj egroeg\n",
"kcaj nhoj yram\n"
],
"example_input": [
"Red Green Blue White Black\n",
"john amal joel george\n"
],
"example_output": [
"deR neerG eulB etihW kcalB\n",
"nhoj lama leoj egroeg\n"
],
"question": "Original problem description:\nWrite a function to reverse each string in a given list of string values.\nWe have its functional test sample:\nassert reverse_string_list(['Red', 'Green', 'Blue', 'White', 'Black'])==['deR', 'neerG', 'eulB', 'etihW', 'kcalB']\nassert reverse_string_list(['john','amal','joel','george'])==['nhoj','lama','leoj','egroeg']\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nRed Green Blue White Black\n\nOutput:\ndeR neerG eulB etihW kcalB\n\n\nExample 2:\nInput:\njohn amal joel george\n\nOutput:\nnhoj lama leoj egroeg\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 237,
"prompt": "Write a python function to find the sublist having minimum length.",
"code": "def Find_Min(lst): \n return min(lst, key=len) ",
"test_imports": [],
"test_list": [
"assert Find_Min([[1],[1,2],[1,2,3]]) == [1]",
"assert Find_Min([[1,1],[1,1,1],[1,2,7,8]]) == [1,1]",
"assert Find_Min([['x'],['x','y'],['x','y','z']]) == ['x']"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n1 2\n1 2 3\n",
"1 1\n1 1 1\n1 2 7 8\n",
"x\nx y\nx y z\n"
],
"test_output": [
"1\n",
"1 1\n",
"x\n"
],
"example_input": [
"1\n1 2\n1 2 3\n",
"1 1\n1 1 1\n1 2 7 8\n"
],
"example_output": [
"1\n",
"1 1\n"
],
"question": "Original problem description:\nWrite a python function to find the sublist having minimum length.\nWe have its functional test sample:\nassert Find_Min([[1],[1,2],[1,2,3]]) == [1]\nassert Find_Min([[1,1],[1,1,1],[1,2,7,8]]) == [1,1]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n1 2\n1 2 3\n\nOutput:\n1\n\n\nExample 2:\nInput:\n1 1\n1 1 1\n1 2 7 8\n\nOutput:\n1 1\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 238,
"prompt": "Write a function to find the area of a rectangle.",
"code": "def rectangle_area(l,b):\n area=l*b\n return area",
"test_imports": [],
"test_list": [
"assert rectangle_area(10,20)==200",
"assert rectangle_area(10,5)==50",
"assert rectangle_area(4,2)==8"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"10\n20\n",
"10\n5\n",
"4\n2\n"
],
"test_output": [
"200\n",
"50\n",
"8\n"
],
"example_input": [
"10\n20\n",
"10\n5\n"
],
"example_output": [
"200\n",
"50\n"
],
"question": "Original problem description:\nWrite a function to find the area of a rectangle.\nWe have its functional test sample:\nassert rectangle_area(10,20)==200\nassert rectangle_area(10,5)==50\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n10\n20\n\nOutput:\n200\n\n\nExample 2:\nInput:\n10\n5\n\nOutput:\n50\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 239,
"prompt": "Write a function to remove uppercase substrings from a given string.",
"code": "import re\ndef remove_uppercase(str1):\n return re.sub('[A-Z]', '', str1)",
"test_imports": [],
"test_list": [
"assert remove_uppercase('cAstyoUrFavoRitETVshoWs') == 'cstyoravoitshos'",
"assert remove_uppercase('wAtchTheinTernEtrAdIo') == 'wtchheinerntrdo'",
"assert remove_uppercase('VoicESeaRchAndreComMendaTionS') == 'oiceachndreomendaion'"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"cAstyoUrFavoRitETVshoWs\n",
"wAtchTheinTernEtrAdIo\n",
"VoicESeaRchAndreComMendaTionS\n"
],
"test_output": [
"cstyoravoitshos\n",
"wtchheinerntrdo\n",
"oiceachndreomendaion\n"
],
"example_input": [
"cAstyoUrFavoRitETVshoWs\n",
"wAtchTheinTernEtrAdIo\n"
],
"example_output": [
"cstyoravoitshos\n",
"wtchheinerntrdo\n"
],
"question": "Original problem description:\nWrite a function to remove uppercase substrings from a given string.\nWe have its functional test sample:\nassert remove_uppercase('cAstyoUrFavoRitETVshoWs') == 'cstyoravoitshos'\nassert remove_uppercase('wAtchTheinTernEtrAdIo') == 'wtchheinerntrdo'\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\ncAstyoUrFavoRitETVshoWs\n\nOutput:\ncstyoravoitshos\n\n\nExample 2:\nInput:\nwAtchTheinTernEtrAdIo\n\nOutput:\nwtchheinerntrdo\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 240,
"prompt": "Write a python function to get the first element of each sublist.",
"code": "def Extract(lst): \n return [item[0] for item in lst] ",
"test_imports": [],
"test_list": [
"assert Extract([[1, 2], [3, 4, 5], [6, 7, 8, 9]]) == [1, 3, 6]",
"assert Extract([[1,2,3],[4, 5]]) == [1,4]",
"assert Extract([[9,8,1],[1,2]]) == [9,1]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2\n3 4 5\n6 7 8 9\n",
"1 2 3\n4 5\n",
"9 8 1\n1 2\n"
],
"test_output": [
"1 3 6\n",
"1 4\n",
"9 1\n"
],
"example_input": [
"1 2\n3 4 5\n6 7 8 9\n",
"1 2 3\n4 5\n"
],
"example_output": [
"1 3 6\n",
"1 4\n"
],
"question": "Original problem description:\nWrite a python function to get the first element of each sublist.\nWe have its functional test sample:\nassert Extract([[1, 2], [3, 4, 5], [6, 7, 8, 9]]) == [1, 3, 6]\nassert Extract([[1,2,3],[4, 5]]) == [1,4]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2\n3 4 5\n6 7 8 9\n\nOutput:\n1 3 6\n\n\nExample 2:\nInput:\n1 2 3\n4 5\n\nOutput:\n1 4\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 241,
"prompt": "Write a python function to count the upper case characters in a given string.",
"code": "def upper_ctr(str):\n upper_ctr = 0\n for i in range(len(str)):\n if str[i] >= 'A' and str[i] <= 'Z': upper_ctr += 1\n return upper_ctr",
"test_imports": [],
"test_list": [
"assert upper_ctr('PYthon') == 1",
"assert upper_ctr('BigData') == 1",
"assert upper_ctr('program') == 0"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"PYthon\n",
"BigData\n",
"program\n"
],
"test_output": [
"1\n",
"1\n",
"0\n"
],
"example_input": [
"PYthon\n",
"BigData\n"
],
"example_output": [
"1\n",
"1\n"
],
"question": "Original problem description:\nWrite a python function to count the upper case characters in a given string.\nWe have its functional test sample:\nassert upper_ctr('PYthon') == 1\nassert upper_ctr('BigData') == 1\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nPYthon\n\nOutput:\n1\n\n\nExample 2:\nInput:\nBigData\n\nOutput:\n1\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 242,
"prompt": "Write a function to find all possible combinations of the elements of a given list.",
"code": "def combinations_list(list1):\n if len(list1) == 0:\n return [[]]\n result = []\n for el in combinations_list(list1[1:]):\n result += [el, el+[list1[0]]]\n return result",
"test_imports": [],
"test_list": [
"assert combinations_list(['orange', 'red', 'green', 'blue'])==[[], ['orange'], ['red'], ['red', 'orange'], ['green'], ['green', 'orange'], ['green', 'red'], ['green', 'red', 'orange'], ['blue'], ['blue', 'orange'], ['blue', 'red'], ['blue', 'red', 'orange'], ['blue', 'green'], ['blue', 'green', 'orange'], ['blue', 'green', 'red'], ['blue', 'green', 'red', 'orange']]",
"assert combinations_list(['red', 'green', 'blue', 'white', 'black', 'orange'])==[[], ['red'], ['green'], ['green', 'red'], ['blue'], ['blue', 'red'], ['blue', 'green'], ['blue', 'green', 'red'], ['white'], ['white', 'red'], ['white', 'green'], ['white', 'green', 'red'], ['white', 'blue'], ['white', 'blue', 'red'], ['white', 'blue', 'green'], ['white', 'blue', 'green', 'red'], ['black'], ['black', 'red'], ['black', 'green'], ['black', 'green', 'red'], ['black', 'blue'], ['black', 'blue', 'red'], ['black', 'blue', 'green'], ['black', 'blue', 'green', 'red'], ['black', 'white'], ['black', 'white', 'red'], ['black', 'white', 'green'], ['black', 'white', 'green', 'red'], ['black', 'white', 'blue'], ['black', 'white', 'blue', 'red'], ['black', 'white', 'blue', 'green'], ['black', 'white', 'blue', 'green', 'red'], ['orange'], ['orange', 'red'], ['orange', 'green'], ['orange', 'green', 'red'], ['orange', 'blue'], ['orange', 'blue', 'red'], ['orange', 'blue', 'green'], ['orange', 'blue', 'green', 'red'], ['orange', 'white'], ['orange', 'white', 'red'], ['orange', 'white', 'green'], ['orange', 'white', 'green', 'red'], ['orange', 'white', 'blue'], ['orange', 'white', 'blue', 'red'], ['orange', 'white', 'blue', 'green'], ['orange', 'white', 'blue', 'green', 'red'], ['orange', 'black'], ['orange', 'black', 'red'], ['orange', 'black', 'green'], ['orange', 'black', 'green', 'red'], ['orange', 'black', 'blue'], ['orange', 'black', 'blue', 'red'], ['orange', 'black', 'blue', 'green'], ['orange', 'black', 'blue', 'green', 'red'], ['orange', 'black', 'white'], ['orange', 'black', 'white', 'red'], ['orange', 'black', 'white', 'green'], ['orange', 'black', 'white', 'green', 'red'], ['orange', 'black', 'white', 'blue'], ['orange', 'black', 'white', 'blue', 'red'], ['orange', 'black', 'white', 'blue', 'green'], ['orange', 'black', 'white', 'blue', 'green', 'red']]",
"assert combinations_list(['red', 'green', 'black', 'orange'])==[[], ['red'], ['green'], ['green', 'red'], ['black'], ['black', 'red'], ['black', 'green'], ['black', 'green', 'red'], ['orange'], ['orange', 'red'], ['orange', 'green'], ['orange', 'green', 'red'], ['orange', 'black'], ['orange', 'black', 'red'], ['orange', 'black', 'green'], ['orange', 'black', 'green', 'red']]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"orange red green blue\n",
"red green blue white black orange\n",
"red green black orange\n"
],
"test_output": [
"orange\nred\nred orange\ngreen\ngreen orange\ngreen red\ngreen red orange\nblue\nblue orange\nblue red\nblue red orange\nblue green\nblue green orange\nblue green red\nblue green red orange\n",
"red\ngreen\ngreen red\nblue\nblue red\nblue green\nblue green red\nwhite\nwhite red\nwhite green\nwhite green red\nwhite blue\nwhite blue red\nwhite blue green\nwhite blue green red\nblack\nblack red\nblack green\nblack green red\nblack blue\nblack blue red\nblack blue green\nblack blue green red\nblack white\nblack white red\nblack white green\nblack white green red\nblack white blue\nblack white blue red\nblack white blue green\nblack white blue green red\norange\norange red\norange green\norange green red\norange blue\norange blue red\norange blue green\norange blue green red\norange white\norange white red\norange white green\norange white green red\norange white blue\norange white blue red\norange white blue green\norange white blue green red\norange black\norange black red\norange black green\norange black green red\norange black blue\norange black blue red\norange black blue green\norange black blue green red\norange black white\norange black white red\norange black white green\norange black white green red\norange black white blue\norange black white blue red\norange black white blue green\norange black white blue green red\n",
"red\ngreen\ngreen red\nblack\nblack red\nblack green\nblack green red\norange\norange red\norange green\norange green red\norange black\norange black red\norange black green\norange black green red\n"
],
"example_input": [
"orange red green blue\n",
"red green blue white black orange\n"
],
"example_output": [
"orange\nred\nred orange\ngreen\ngreen orange\ngreen red\ngreen red orange\nblue\nblue orange\nblue red\nblue red orange\nblue green\nblue green orange\nblue green red\nblue green red orange\n",
"red\ngreen\ngreen red\nblue\nblue red\nblue green\nblue green red\nwhite\nwhite red\nwhite green\nwhite green red\nwhite blue\nwhite blue red\nwhite blue green\nwhite blue green red\nblack\nblack red\nblack green\nblack green red\nblack blue\nblack blue red\nblack blue green\nblack blue green red\nblack white\nblack white red\nblack white green\nblack white green red\nblack white blue\nblack white blue red\nblack white blue green\nblack white blue green red\norange\norange red\norange green\norange green red\norange blue\norange blue red\norange blue green\norange blue green red\norange white\norange white red\norange white green\norange white green red\norange white blue\norange white blue red\norange white blue green\norange white blue green red\norange black\norange black red\norange black green\norange black green red\norange black blue\norange black blue red\norange black blue green\norange black blue green red\norange black white\norange black white red\norange black white green\norange black white green red\norange black white blue\norange black white blue red\norange black white blue green\norange black white blue green red\n"
],
"question": "Original problem description:\nWrite a function to find all possible combinations of the elements of a given list.\nWe have its functional test sample:\nassert combinations_list(['orange', 'red', 'green', 'blue'])==[[], ['orange'], ['red'], ['red', 'orange'], ['green'], ['green', 'orange'], ['green', 'red'], ['green', 'red', 'orange'], ['blue'], ['blue', 'orange'], ['blue', 'red'], ['blue', 'red', 'orange'], ['blue', 'green'], ['blue', 'green', 'orange'], ['blue', 'green', 'red'], ['blue', 'green', 'red', 'orange']]\nassert combinations_list(['red', 'green', 'blue', 'white', 'black', 'orange'])==[[], ['red'], ['green'], ['green', 'red'], ['blue'], ['blue', 'red'], ['blue', 'green'], ['blue', 'green', 'red'], ['white'], ['white', 'red'], ['white', 'green'], ['white', 'green', 'red'], ['white', 'blue'], ['white', 'blue', 'red'], ['white', 'blue', 'green'], ['white', 'blue', 'green', 'red'], ['black'], ['black', 'red'], ['black', 'green'], ['black', 'green', 'red'], ['black', 'blue'], ['black', 'blue', 'red'], ['black', 'blue', 'green'], ['black', 'blue', 'green', 'red'], ['black', 'white'], ['black', 'white', 'red'], ['black', 'white', 'green'], ['black', 'white', 'green', 'red'], ['black', 'white', 'blue'], ['black', 'white', 'blue', 'red'], ['black', 'white', 'blue', 'green'], ['black', 'white', 'blue', 'green', 'red'], ['orange'], ['orange', 'red'], ['orange', 'green'], ['orange', 'green', 'red'], ['orange', 'blue'], ['orange', 'blue', 'red'], ['orange', 'blue', 'green'], ['orange', 'blue', 'green', 'red'], ['orange', 'white'], ['orange', 'white', 'red'], ['orange', 'white', 'green'], ['orange', 'white', 'green', 'red'], ['orange', 'white', 'blue'], ['orange', 'white', 'blue', 'red'], ['orange', 'white', 'blue', 'green'], ['orange', 'white', 'blue', 'green', 'red'], ['orange', 'black'], ['orange', 'black', 'red'], ['orange', 'black', 'green'], ['orange', 'black', 'green', 'red'], ['orange', 'black', 'blue'], ['orange', 'black', 'blue', 'red'], ['orange', 'black', 'blue', 'green'], ['orange', 'black', 'blue', 'green', 'red'], ['orange', 'black', 'white'], ['orange', 'black', 'white', 'red'], ['orange', 'black', 'white', 'green'], ['orange', 'black', 'white', 'green', 'red'], ['orange', 'black', 'white', 'blue'], ['orange', 'black', 'white', 'blue', 'red'], ['orange', 'black', 'white', 'blue', 'green'], ['orange', 'black', 'white', 'blue', 'green', 'red']]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\norange red green blue\n\nOutput:\norange\nred\nred orange\ngreen\ngreen orange\ngreen red\ngreen red orange\nblue\nblue orange\nblue red\nblue red orange\nblue green\nblue green orange\nblue green red\nblue green red orange\n\n\nExample 2:\nInput:\nred green blue white black orange\n\nOutput:\nred\ngreen\ngreen red\nblue\nblue red\nblue green\nblue green red\nwhite\nwhite red\nwhite green\nwhite green red\nwhite blue\nwhite blue red\nwhite blue green\nwhite blue green red\nblack\nblack red\nblack green\nblack green red\nblack blue\nblack blue red\nblack blue green\nblack blue green red\nblack white\nblack white red\nblack white green\nblack white green red\nblack white blue\nblack white blue red\nblack white blue green\nblack white blue green red\norange\norange red\norange green\norange green red\norange blue\norange blue red\norange blue green\norange blue green red\norange white\norange white red\norange white green\norange white green red\norange white blue\norange white blue red\norange white blue green\norange white blue green red\norange black\norange black red\norange black green\norange black green red\norange black blue\norange black blue red\norange black blue green\norange black blue green red\norange black white\norange black white red\norange black white green\norange black white green red\norange black white blue\norange black white blue red\norange black white blue green\norange black white blue green red\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 243,
"prompt": "Write a function to find the maximum product subarray of the given array.",
"code": "def max_subarray_product(arr):\n\tn = len(arr)\n\tmax_ending_here = 1\n\tmin_ending_here = 1\n\tmax_so_far = 0\n\tflag = 0\n\tfor i in range(0, n):\n\t\tif arr[i] > 0:\n\t\t\tmax_ending_here = max_ending_here * arr[i]\n\t\t\tmin_ending_here = min (min_ending_here * arr[i], 1)\n\t\t\tflag = 1\n\t\telif arr[i] == 0:\n\t\t\tmax_ending_here = 1\n\t\t\tmin_ending_here = 1\n\t\telse:\n\t\t\ttemp = max_ending_here\n\t\t\tmax_ending_here = max (min_ending_here * arr[i], 1)\n\t\t\tmin_ending_here = temp * arr[i]\n\t\tif (max_so_far < max_ending_here):\n\t\t\tmax_so_far = max_ending_here\n\tif flag == 0 and max_so_far == 0:\n\t\treturn 0\n\treturn max_so_far",
"test_imports": [],
"test_list": [
"assert max_subarray_product([1, -2, -3, 0, 7, -8, -2]) == 112",
"assert max_subarray_product([6, -3, -10, 0, 2]) == 180",
"assert max_subarray_product([-2, -40, 0, -2, -3]) == 80"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 -2 -3 0 7 -8 -2\n",
"6 -3 -10 0 2\n",
"-2 -40 0 -2 -3\n"
],
"test_output": [
"112\n",
"180\n",
"80\n"
],
"example_input": [
"1 -2 -3 0 7 -8 -2\n",
"6 -3 -10 0 2\n"
],
"example_output": [
"112\n",
"180\n"
],
"question": "Original problem description:\nWrite a function to find the maximum product subarray of the given array.\nWe have its functional test sample:\nassert max_subarray_product([1, -2, -3, 0, 7, -8, -2]) == 112\nassert max_subarray_product([6, -3, -10, 0, 2]) == 180\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 -2 -3 0 7 -8 -2\n\nOutput:\n112\n\n\nExample 2:\nInput:\n6 -3 -10 0 2\n\nOutput:\n180\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 244,
"prompt": "Write a function to check if all values are same in a dictionary.",
"code": "def check_value(dict, n):\n result = all(x == n for x in dict.values()) \n return result",
"test_imports": [],
"test_list": [
"assert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},10)==False",
"assert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},12)==True",
"assert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},5)==False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"{'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12}\n10\n",
"{'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12}\n12\n",
"{'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12}\n5\n"
],
"test_output": [
"False\n",
"True\n",
"False\n"
],
"example_input": [
"{'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12}\n10\n",
"{'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12}\n12\n"
],
"example_output": [
"False\n",
"True\n"
],
"question": "Original problem description:\nWrite a function to check if all values are same in a dictionary.\nWe have its functional test sample:\nassert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},10)==False\nassert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},12)==True\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n{'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12}\n10\n\nOutput:\nFalse\n\n\nExample 2:\nInput:\n{'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12}\n12\n\nOutput:\nTrue\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 245,
"prompt": "Write a function to drop empty items from a given dictionary.",
"code": "def drop_empty(dict1):\n dict1 = {key:value for (key, value) in dict1.items() if value is not None}\n return dict1",
"test_imports": [],
"test_list": [
"assert drop_empty({'c1': 'Red', 'c2': 'Green', 'c3':None})=={'c1': 'Red', 'c2': 'Green'}",
"assert drop_empty({'c1': 'Red', 'c2': None, 'c3':None})=={'c1': 'Red'}",
"assert drop_empty({'c1': None, 'c2': 'Green', 'c3':None})=={ 'c2': 'Green'}"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"{'c1': 'Red', 'c2': 'Green', 'c3': None}\n",
"{'c1': 'Red', 'c2': None, 'c3': None}\n",
"{'c1': None, 'c2': 'Green', 'c3': None}\n"
],
"test_output": [
"{'c1': 'Red', 'c2': 'Green'}\n",
"{'c1': 'Red'}\n",
"{'c2': 'Green'}\n"
],
"example_input": [
"{'c1': 'Red', 'c2': 'Green', 'c3': None}\n",
"{'c1': 'Red', 'c2': None, 'c3': None}\n"
],
"example_output": [
"{'c1': 'Red', 'c2': 'Green'}\n",
"{'c1': 'Red'}\n"
],
"question": "Original problem description:\nWrite a function to drop empty items from a given dictionary.\nWe have its functional test sample:\nassert drop_empty({'c1': 'Red', 'c2': 'Green', 'c3':None})=={'c1': 'Red', 'c2': 'Green'}\nassert drop_empty({'c1': 'Red', 'c2': None, 'c3':None})=={'c1': 'Red'}\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n{'c1': 'Red', 'c2': 'Green', 'c3': None}\n\nOutput:\n{'c1': 'Red', 'c2': 'Green'}\n\n\nExample 2:\nInput:\n{'c1': 'Red', 'c2': None, 'c3': None}\n\nOutput:\n{'c1': 'Red'}\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 246,
"prompt": "Write a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array.",
"code": "def max_product(arr): \n n = len(arr)\n mpis = arr[:]\n for i in range(n): \n current_prod = arr[i]\n j = i + 1\n while j < n:\n if arr[j-1] > arr[j]: \n break\n current_prod *= arr[j]\n if current_prod > mpis[j]:\n mpis[j] = current_prod \n j = j + 1\n return max(mpis)",
"test_imports": [],
"test_list": [
"assert max_product([3, 100, 4, 5, 150, 6]) == 3000",
"assert max_product([4, 42, 55, 68, 80]) == 50265600",
"assert max_product([10, 22, 9, 33, 21, 50, 41, 60]) == 2460"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"3 100 4 5 150 6\n",
"4 42 55 68 80\n",
"10 22 9 33 21 50 41 60\n"
],
"test_output": [
"3000\n",
"50265600\n",
"2460\n"
],
"example_input": [
"3 100 4 5 150 6\n",
"4 42 55 68 80\n"
],
"example_output": [
"3000\n",
"50265600\n"
],
"question": "Original problem description:\nWrite a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array.\nWe have its functional test sample:\nassert max_product([3, 100, 4, 5, 150, 6]) == 3000\nassert max_product([4, 42, 55, 68, 80]) == 50265600\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n3 100 4 5 150 6\n\nOutput:\n3000\n\n\nExample 2:\nInput:\n4 42 55 68 80\n\nOutput:\n50265600\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 247,
"prompt": "Write a function to find the pairwise addition of the neighboring elements of the given tuple.",
"code": "def add_pairwise(test_tup):\n res = tuple(i + j for i, j in zip(test_tup, test_tup[1:]))\n return (res) ",
"test_imports": [],
"test_list": [
"assert add_pairwise((1, 5, 7, 8, 10)) == (6, 12, 15, 18)",
"assert add_pairwise((2, 6, 8, 9, 11)) == (8, 14, 17, 20)",
"assert add_pairwise((3, 7, 9, 10, 12)) == (10, 16, 19, 22)"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1\n5\n7\n8\n10\n",
"2\n6\n8\n9\n11\n",
"3\n7\n9\n10\n12\n"
],
"test_output": [
"6 12 15 18\n",
"8 14 17 20\n",
"10 16 19 22\n"
],
"example_input": [
"1\n5\n7\n8\n10\n",
"2\n6\n8\n9\n11\n"
],
"example_output": [
"6 12 15 18\n",
"8 14 17 20\n"
],
"question": "Original problem description:\nWrite a function to find the pairwise addition of the neighboring elements of the given tuple.\nWe have its functional test sample:\nassert add_pairwise((1, 5, 7, 8, 10)) == (6, 12, 15, 18)\nassert add_pairwise((2, 6, 8, 9, 11)) == (8, 14, 17, 20)\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1\n5\n7\n8\n10\n\nOutput:\n6 12 15 18\n\n\nExample 2:\nInput:\n2\n6\n8\n9\n11\n\nOutput:\n8 14 17 20\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 248,
"prompt": "Write a python function to find the product of the array multiplication modulo n.",
"code": "def find_remainder(arr, n): \n mul = 1\n for i in range(len(arr)): \n mul = (mul * (arr[i] % n)) % n \n return mul % n ",
"test_imports": [],
"test_list": [
"assert find_remainder([ 100, 10, 5, 25, 35, 14 ],11) ==9",
"assert find_remainder([1,1,1],1) == 0",
"assert find_remainder([1,2,1],2) == 0"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"100 10 5 25 35 14\n11\n",
"1 1 1\n1\n",
"1 2 1\n2\n"
],
"test_output": [
"9\n",
"0\n",
"0\n"
],
"example_input": [
"100 10 5 25 35 14\n11\n",
"1 1 1\n1\n"
],
"example_output": [
"9\n",
"0\n"
],
"question": "Original problem description:\nWrite a python function to find the product of the array multiplication modulo n.\nWe have its functional test sample:\nassert find_remainder([ 100, 10, 5, 25, 35, 14 ],11) ==9\nassert find_remainder([1,1,1],1) == 0\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n100 10 5 25 35 14\n11\n\nOutput:\n9\n\n\nExample 2:\nInput:\n1 1 1\n1\n\nOutput:\n0\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 249,
"prompt": "Write a python function to check whether the given list contains consecutive numbers or not.",
"code": "def check_Consecutive(l): \n return sorted(l) == list(range(min(l),max(l)+1)) ",
"test_imports": [],
"test_list": [
"assert check_Consecutive([1,2,3,4,5]) == True",
"assert check_Consecutive([1,2,3,5,6]) == False",
"assert check_Consecutive([1,2,1]) == False"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3 4 5\n",
"1 2 3 5 6\n",
"1 2 1\n"
],
"test_output": [
"True\n",
"False\n",
"False\n"
],
"example_input": [
"1 2 3 4 5\n",
"1 2 3 5 6\n"
],
"example_output": [
"True\n",
"False\n"
],
"question": "Original problem description:\nWrite a python function to check whether the given list contains consecutive numbers or not.\nWe have its functional test sample:\nassert check_Consecutive([1,2,3,4,5]) == True\nassert check_Consecutive([1,2,3,5,6]) == False\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3 4 5\n\nOutput:\nTrue\n\n\nExample 2:\nInput:\n1 2 3 5 6\n\nOutput:\nFalse\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 251,
"prompt": "Write a function to replace characters in a string.",
"code": "def replace_char(str1,ch,newch):\n str2 = str1.replace(ch, newch)\n return str2",
"test_imports": [],
"test_list": [
"assert replace_char(\"polygon\",'y','l')==(\"pollgon\")",
"assert replace_char(\"character\",'c','a')==(\"aharaater\")",
"assert replace_char(\"python\",'l','a')==(\"python\")"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"polygon\ny\nl\n",
"character\nc\na\n",
"python\nl\na\n"
],
"test_output": [
"pollgon\n",
"aharaater\n",
"python\n"
],
"example_input": [
"polygon\ny\nl\n",
"character\nc\na\n"
],
"example_output": [
"pollgon\n",
"aharaater\n"
],
"question": "Original problem description:\nWrite a function to replace characters in a string.\nWe have its functional test sample:\nassert replace_char(\"polygon\",'y','l')==(\"pollgon\")\nassert replace_char(\"character\",'c','a')==(\"aharaater\")\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\npolygon\ny\nl\n\nOutput:\npollgon\n\n\nExample 2:\nInput:\ncharacter\nc\na\n\nOutput:\naharaater\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 252,
"prompt": "Write a function to sort a dictionary by value.",
"code": "from collections import Counter\ndef sort_counter(dict1):\n x = Counter(dict1)\n sort_counter=x.most_common()\n return sort_counter",
"test_imports": [],
"test_list": [
"assert sort_counter({'Math':81, 'Physics':83, 'Chemistry':87})==[('Chemistry', 87), ('Physics', 83), ('Math', 81)]",
"assert sort_counter({'Math':400, 'Physics':300, 'Chemistry':250})==[('Math', 400), ('Physics', 300), ('Chemistry', 250)]",
"assert sort_counter({'Math':900, 'Physics':1000, 'Chemistry':1250})==[('Chemistry', 1250), ('Physics', 1000), ('Math', 900)]"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"{'Math': 81, 'Physics': 83, 'Chemistry': 87}\n",
"{'Math': 400, 'Physics': 300, 'Chemistry': 250}\n",
"{'Math': 900, 'Physics': 1000, 'Chemistry': 1250}\n"
],
"test_output": [
"Chemistry 87\nPhysics 83\nMath 81\n",
"Math 400\nPhysics 300\nChemistry 250\n",
"Chemistry 1250\nPhysics 1000\nMath 900\n"
],
"example_input": [
"{'Math': 81, 'Physics': 83, 'Chemistry': 87}\n",
"{'Math': 400, 'Physics': 300, 'Chemistry': 250}\n"
],
"example_output": [
"Chemistry 87\nPhysics 83\nMath 81\n",
"Math 400\nPhysics 300\nChemistry 250\n"
],
"question": "Original problem description:\nWrite a function to sort a dictionary by value.\nWe have its functional test sample:\nassert sort_counter({'Math':81, 'Physics':83, 'Chemistry':87})==[('Chemistry', 87), ('Physics', 83), ('Math', 81)]\nassert sort_counter({'Math':400, 'Physics':300, 'Chemistry':250})==[('Math', 400), ('Physics', 300), ('Chemistry', 250)]\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n{'Math': 81, 'Physics': 83, 'Chemistry': 87}\n\nOutput:\nChemistry 87\nPhysics 83\nMath 81\n\n\nExample 2:\nInput:\n{'Math': 400, 'Physics': 300, 'Chemistry': 250}\n\nOutput:\nMath 400\nPhysics 300\nChemistry 250\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 253,
"prompt": "Write a python function to find the sum of the largest and smallest value in a given array.",
"code": "def big_sum(nums):\n sum= max(nums)+min(nums)\n return sum",
"test_imports": [],
"test_list": [
"assert big_sum([1,2,3]) == 4",
"assert big_sum([-1,2,3,4]) == 3",
"assert big_sum([2,3,6]) == 8"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"1 2 3\n",
"-1 2 3 4\n",
"2 3 6\n"
],
"test_output": [
"4\n",
"3\n",
"8\n"
],
"example_input": [
"1 2 3\n",
"-1 2 3 4\n"
],
"example_output": [
"4\n",
"3\n"
],
"question": "Original problem description:\nWrite a python function to find the sum of the largest and smallest value in a given array.\nWe have its functional test sample:\nassert big_sum([1,2,3]) == 4\nassert big_sum([-1,2,3,4]) == 3\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n1 2 3\n\nOutput:\n4\n\n\nExample 2:\nInput:\n-1 2 3 4\n\nOutput:\n3\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 254,
"prompt": "Write a python function to convert the given string to lower case.",
"code": "def is_lower(string):\n return (string.lower())",
"test_imports": [],
"test_list": [
"assert is_lower(\"InValid\") == \"invalid\"",
"assert is_lower(\"TruE\") == \"true\"",
"assert is_lower(\"SenTenCE\") == \"sentence\""
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"InValid\n",
"TruE\n",
"SenTenCE\n"
],
"test_output": [
"invalid\n",
"true\n",
"sentence\n"
],
"example_input": [
"InValid\n",
"TruE\n"
],
"example_output": [
"invalid\n",
"true\n"
],
"question": "Original problem description:\nWrite a python function to convert the given string to lower case.\nWe have its functional test sample:\nassert is_lower(\"InValid\") == \"invalid\"\nassert is_lower(\"TruE\") == \"true\"\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nInValid\n\nOutput:\ninvalid\n\n\nExample 2:\nInput:\nTruE\n\nOutput:\ntrue\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 255,
"prompt": "Write a function to remove lowercase substrings from a given string.",
"code": "import re\ndef remove_lowercase(str1):\n return re.sub('[a-z]', '', str1)",
"test_imports": [],
"test_list": [
"assert remove_lowercase(\"PYTHon\")==('PYTH')",
"assert remove_lowercase(\"FInD\")==('FID')",
"assert remove_lowercase(\"STRinG\")==('STRG')"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"PYTHon\n",
"FInD\n",
"STRinG\n"
],
"test_output": [
"PYTH\n",
"FID\n",
"STRG\n"
],
"example_input": [
"PYTHon\n",
"FInD\n"
],
"example_output": [
"PYTH\n",
"FID\n"
],
"question": "Original problem description:\nWrite a function to remove lowercase substrings from a given string.\nWe have its functional test sample:\nassert remove_lowercase(\"PYTHon\")==('PYTH')\nassert remove_lowercase(\"FInD\")==('FID')\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\nPYTHon\n\nOutput:\nPYTH\n\n\nExample 2:\nInput:\nFInD\n\nOutput:\nFID\n\n\n"
},
{
"source_file": "charlessutton@: Benchmark Questions Verification V2.ipynb",
"task_id": 256,
"prompt": "Write a python function to find the first digit of a given number.",
"code": "def first_Digit(n) : \n while n >= 10: \n n = n / 10 \n return int(n) ",
"test_imports": [],
"test_list": [
"assert first_Digit(123) == 1",
"assert first_Digit(456) == 4",
"assert first_Digit(12) == 1"
],
"exe_method": "stdin",
"test_time_limit": 1,
"solutions": null,
"dataset": "MBPP",
"test_input": [
"123\n",
"456\n",
"12\n"
],
"test_output": [
"1\n",
"4\n",
"1\n"
],
"example_input": [
"123\n",
"456\n"
],
"example_output": [
"1\n",
"4\n"
],
"question": "Original problem description:\nWrite a python function to find the first digit of a given number.\nWe have its functional test sample:\nassert first_Digit(123) == 1\nassert first_Digit(456) == 4\n\nHowever, the functional I/O tests have been converted to a standard stdin/stdout format for this task. The followings are some input and output examples. Please read from stdin and write to stdout exactly as shown below. \nYour solution must strictly follow these formats. For instance, many raw functional test cases contain a list like [a1, a2, a3, ...]. After conversion, these may appear as a single line of input: \"a1 a2 a3 ...\". You should read this line directly, without first reading the length of the list.\n\nExample 1:\nInput:\n123\n\nOutput:\n1\n\n\nExample 2:\nInput:\n456\n\nOutput:\n4\n\n\n"
}
] |