Cody

# Problem 2858. Matlab Basics - Logical Tests I

Solution 1852247

Submitted on 18 Jun 2019 by MAHMOUD ABDEL-LATIF
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x = 1884; y = 1; assert(isequal(leap(x),y))

leap = Columns 1 through 15 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 Columns 16 through 30 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 Columns 31 through 45 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 Columns 46 through 60 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 Columns 61 through 75 240 244 248 252 256 260 264 268 272 276 280 284 288 292 296 Columns 76 through 90 300 304 308 312 316 320 324 328 332 336 340 344 348 352 356 Columns 91 through 105 360 364 368 372 376 380 384 388 392 396 400 404 408 412 416 Columns 106 through 120 420 424 428 432 436 440 444 448 452 456 460 464 468 472 476 Columns 121 through 135 480 484 488 492 496 500 504 508 512 516 520 524 528 532 536 Columns 136 through 150 540 544 548 552 556 560 564 568 572 576 580 584 588 592 596 Columns 151 through 165 600 604 608 612 616 620 624 628 632 636 640 644 648 652 656 Columns 166 through 180 660 664 668 672 676 680 684 688 692 696 700 704 708 712 716 Columns 181 through 195 720 724 728 732 736 740 744 748 752 756 760 764 768 772 776 Columns 196 through 210 780 784 788 792 796 800 804 808 812 816 820 824 828 832 836 Columns 211 through 225 840 844 848 852 856 860 864 868 872 876 880 884 888 892 896 Columns 226 through 240 900 904 908 912 916 920 924 928 932 936 940 944 948 952 956 Columns 241 through 255 960 964 968 972 976 980 984 988 992 996 1000 1004 1008 1012 1016 Columns 256 through 270 1020 1024 1028 1032 1036 1040 1044 1048 1052 1056 1060 1064 1068 1072 1076 Columns 271 through 285 1080 1084 1088 1092 1096 1100 1104 1108 1112 1116 1120 1124 1128 1132 1136 Columns 286 through 300 1140 1144 1148 1152 1156 1160 1164 1168 1172 1176 1180 1184 1188 1192 1196 Columns 301 through 315 1200 1204 1208 1212 1216 1220 1224 1228 1232 1236 1240 1244 1248 1252 1256 Columns 316 through 330 1260 1264 1268 1272 1276 1280 1284 1288 1292 1296 1300 1304 1308 1312 1316 Columns 331 through 345 1320 1324 1328 1332 1336 1340 1344 1348 1352 1356 1360 1364 1368 1372 1376 Columns 346 through 360 1380 1384 1388 1392 1396 1400 1404 1408 1412 1416 1420 1424 1428 1432 1436 Columns 361 through 375 1440 1444 1448 1452 1456 1460 1464 1468 1472 1476 1480 1484 1488 1492 1496 Columns 376 through 390 1500 1504 1508 1512 1516 1520 1524 1528 1532 1536 1540 1544 1548 1552 1556 Columns 391 through 405 1560 1564 1568 1572 1576 1580 1584 1588 1592 1596 1600 1604 1608 1612 1616 Columns 406 through 420 1620 1624 1628 1632 1636 1640 1644 1648 1652 1656 1660 1664 1668 1672 1676 Columns 421 through 435 1680 1684 1688 1692 1696 1700 1704 1708 1712 1716 1720 1724 1728 1732 1736 Columns 436 through 450 1740 1744 1748 1752 1756 1760 1764 1768 1772 1776 1780 1784 1788 1792 1796 Columns 451 through 465 1800 1804 1808 1812 1816 1820 1824 1828 1832 1836 1840 1844 1848 1852 1856 Columns 466 through 480 1860 1864 1868 1872 1876 1880 1884 1888 1892 1896 1900 1904 1908 1912 1916 Columns 481 through 495 1920 1924 1928 1932 1936 1940 1944 1948 1952 1956 1960 1964 1968 1972 1976 Columns 496 through 506 1980 1984 1988 1992 1996 2000 2004 2008 2012 2016 2020

2   Pass
x = 3; y = 0; assert(isequal(leap(x),y))

leap = Columns 1 through 15 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 Columns 16 through 30 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 Columns 31 through 45 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 Columns 46 through 60 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 Columns 61 through 75 240 244 248 252 256 260 264 268 272 276 280 284 288 292 296 Columns 76 through 90 300 304 308 312 316 320 324 328 332 336 340 344 348 352 356 Columns 91 through 105 360 364 368 372 376 380 384 388 392 396 400 404 408 412 416 Columns 106 through 120 420 424 428 432 436 440 444 448 452 456 460 464 468 472 476 Columns 121 through 135 480 484 488 492 496 500 504 508 512 516 520 524 528 532 536 Columns 136 through 150 540 544 548 552 556 560 564 568 572 576 580 584 588 592 596 Columns 151 through 165 600 604 608 612 616 620 624 628 632 636 640 644 648 652 656 Columns 166 through 180 660 664 668 672 676 680 684 688 692 696 700 704 708 712 716 Columns 181 through 195 720 724 728 732 736 740 744 748 752 756 760 764 768 772 776 Columns 196 through 210 780 784 788 792 796 800 804 808 812 816 820 824 828 832 836 Columns 211 through 225 840 844 848 852 856 860 864 868 872 876 880 884 888 892 896 Columns 226 through 240 900 904 908 912 916 920 924 928 932 936 940 944 948 952 956 Columns 241 through 255 960 964 968 972 976 980 984 988 992 996 1000 1004 1008 1012 1016 Columns 256 through 270 1020 1024 1028 1032 1036 1040 1044 1048 1052 1056 1060 1064 1068 1072 1076 Columns 271 through 285 1080 1084 1088 1092 1096 1100 1104 1108 1112 1116 1120 1124 1128 1132 1136 Columns 286 through 300 1140 1144 1148 1152 1156 1160 1164 1168 1172 1176 1180 1184 1188 1192 1196 Columns 301 through 315 1200 1204 1208 1212 1216 1220 1224 1228 1232 1236 1240 1244 1248 1252 1256 Columns 316 through 330 1260 1264 1268 1272 1276 1280 1284 1288 1292 1296 1300 1304 1308 1312 1316 Columns 331 through 345 1320 1324 1328 1332 1336 1340 1344 1348 1352 1356 1360 1364 1368 1372 1376 Columns 346 through 360 1380 1384 1388 1392 1396 1400 1404 1408 1412 1416 1420 1424 1428 1432 1436 Columns 361 through 375 1440 1444 1448 1452 1456 1460 1464 1468 1472 1476 1480 1484 1488 1492 1496 Columns 376 through 390 1500 1504 1508 1512 1516 1520 1524 1528 1532 1536 1540 1544 1548 1552 1556 Columns 391 through 405 1560 1564 1568 1572 1576 1580 1584 1588 1592 1596 1600 1604 1608 1612 1616 Columns 406 through 420 1620 1624 1628 1632 1636 1640 1644 1648 1652 1656 1660 1664 1668 1672 1676 Columns 421 through 435 1680 1684 1688 1692 1696 1700 1704 1708 1712 1716 1720 1724 1728 1732 1736 Columns 436 through 450 1740 1744 1748 1752 1756 1760 1764 1768 1772 1776 1780 1784 1788 1792 1796 Columns 451 through 465 1800 1804 1808 1812 1816 1820 1824 1828 1832 1836 1840 1844 1848 1852 1856 Columns 466 through 480 1860 1864 1868 1872 1876 1880 1884 1888 1892 1896 1900 1904 1908 1912 1916 Columns 481 through 495 1920 1924 1928 1932 1936 1940 1944 1948 1952 1956 1960 1964 1968 1972 1976 Columns 496 through 506 1980 1984 1988 1992 1996 2000 2004 2008 2012 2016 2020

3   Pass
x = 522; y = 0; assert(isequal(leap(x),y))

leap = Columns 1 through 15 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 Columns 16 through 30 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 Columns 31 through 45 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 Columns 46 through 60 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 Columns 61 through 75 240 244 248 252 256 260 264 268 272 276 280 284 288 292 296 Columns 76 through 90 300 304 308 312 316 320 324 328 332 336 340 344 348 352 356 Columns 91 through 105 360 364 368 372 376 380 384 388 392 396 400 404 408 412 416 Columns 106 through 120 420 424 428 432 436 440 444 448 452 456 460 464 468 472 476 Columns 121 through 135 480 484 488 492 496 500 504 508 512 516 520 524 528 532 536 Columns 136 through 150 540 544 548 552 556 560 564 568 572 576 580 584 588 592 596 Columns 151 through 165 600 604 608 612 616 620 624 628 632 636 640 644 648 652 656 Columns 166 through 180 660 664 668 672 676 680 684 688 692 696 700 704 708 712 716 Columns 181 through 195 720 724 728 732 736 740 744 748 752 756 760 764 768 772 776 Columns 196 through 210 780 784 788 792 796 800 804 808 812 816 820 824 828 832 836 Columns 211 through 225 840 844 848 852 856 860 864 868 872 876 880 884 888 892 896 Columns 226 through 240 900 904 908 912 916 920 924 928 932 936 940 944 948 952 956 Columns 241 through 255 960 964 968 972 976 980 984 988 992 996 1000 1004 1008 1012 1016 Columns 256 through 270 1020 1024 1028 1032 1036 1040 1044 1048 1052 1056 1060 1064 1068 1072 1076 Columns 271 through 285 1080 1084 1088 1092 1096 1100 1104 1108 1112 1116 1120 1124 1128 1132 1136 Columns 286 through 300 1140 1144 1148 1152 1156 1160 1164 1168 1172 1176 1180 1184 1188 1192 1196 Columns 301 through 315 1200 1204 1208 1212 1216 1220 1224 1228 1232 1236 1240 1244 1248 1252 1256 Columns 316 through 330 1260 1264 1268 1272 1276 1280 1284 1288 1292 1296 1300 1304 1308 1312 1316 Columns 331 through 345 1320 1324 1328 1332 1336 1340 1344 1348 1352 1356 1360 1364 1368 1372 1376 Columns 346 through 360 1380 1384 1388 1392 1396 1400 1404 1408 1412 1416 1420 1424 1428 1432 1436 Columns 361 through 375 1440 1444 1448 1452 1456 1460 1464 1468 1472 1476 1480 1484 1488 1492 1496 Columns 376 through 390 1500 1504 1508 1512 1516 1520 1524 1528 1532 1536 1540 1544 1548 1552 1556 Columns 391 through 405 1560 1564 1568 1572 1576 1580 1584 1588 1592 1596 1600 1604 1608 1612 1616 Columns 406 through 420 1620 1624 1628 1632 1636 1640 1644 1648 1652 1656 1660 1664 1668 1672 1676 Columns 421 through 435 1680 1684 1688 1692 1696 1700 1704 1708 1712 1716 1720 1724 1728 1732 1736 Columns 436 through 450 1740 1744 1748 1752 1756 1760 1764 1768 1772 1776 1780 1784 1788 1792 1796 Columns 451 through 465 1800 1804 1808 1812 1816 1820 1824 1828 1832 1836 1840 1844 1848 1852 1856 Columns 466 through 480 1860 1864 1868 1872 1876 1880 1884 1888 1892 1896 1900 1904 1908 1912 1916 Columns 481 through 495 1920 1924 1928 1932 1936 1940 1944 1948 1952 1956 1960 1964 1968 1972 1976 Columns 496 through 506 1980 1984 1988 1992 1996 2000 2004 2008 2012 2016 2020