├── .github └── workflows │ └── gradle.yml ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── build.gradle ├── cpp ├── _1.cpp ├── _11.cpp ├── _1402.cpp ├── _1431.cpp ├── _1470.cpp ├── _1480.cpp ├── _15.cpp ├── _3.cpp ├── _31.cpp ├── _322.cpp ├── _4.cpp ├── _41.cpp ├── _416.cpp ├── _461.cpp ├── _698.cpp ├── _7.cpp ├── _72.cpp ├── _9.cpp └── _916.cpp ├── database ├── _1050.sql ├── _1068.sql ├── _1069.sql ├── _1075.sql ├── _1076.sql ├── _1082.sql ├── _1083.sql ├── _1084.sql ├── _1113.sql ├── _1141.sql ├── _1142.sql ├── _1148.sql ├── _1173.sql ├── _1179.sql ├── _1211.sql ├── _1241.sql ├── _1251.sql ├── _1270.sql ├── _1280.sql ├── _1285.sql ├── _1294.sql ├── _1303.sql ├── _1308.sql ├── _1322.sql ├── _1327.sql ├── _1341.sql ├── _1350.sql ├── _1355.sql ├── _1364.sql ├── _1369.sql ├── _1371.sql ├── _1378.sql ├── _1384.sql ├── _1393.sql ├── _1407.sql ├── _1421.sql ├── _1435.sql ├── _1445.sql ├── _1484.sql ├── _1495.sql ├── _1511.sql ├── _1517.sql ├── _1527.sql ├── _1543.sql ├── _1565.sql ├── _1571.sql ├── _1581.sql ├── _1587.sql ├── _1596.sql ├── _1607.sql ├── _1623.sql ├── _1633.sql ├── _1661.sql ├── _1667.sql ├── _1677.sql ├── _1683.sql ├── _1693.sql ├── _1709.sql ├── _1729.sql ├── _1741.sql ├── _175.sql ├── _1757.sql ├── _176.sql ├── _177.sql ├── _1777.sql ├── _178.sql ├── _1789.sql ├── _1795.sql ├── _180.sql ├── _1809.sql ├── _181.sql ├── _182.sql ├── _1821.sql ├── _183.sql ├── _184.sql ├── _185.sql ├── _1853.sql ├── _1873.sql ├── _196.sql ├── _197.sql ├── _1978.sql ├── _2026.sql ├── _2072.sql ├── _2082.sql ├── _2205.sql ├── _262.sql ├── _2990.sql ├── _3051.sql ├── _3059.sql ├── _3150.sql ├── _3172.sql ├── _3198.sql ├── _511.sql ├── _512.sql ├── _534.sql ├── _569.sql ├── _570.sql ├── _571.sql ├── _574.sql ├── _577.sql ├── _578.sql ├── _580.sql ├── _584.sql ├── _585.sql ├── _586.sql ├── _595.sql ├── _596.sql ├── _597.sql ├── _601.sql ├── _602.sql ├── _603.sql ├── _607.sql ├── _608.sql ├── _610.sql ├── _612.sql ├── _613.sql ├── _614.sql ├── _615.sql ├── _618.sql ├── _619.sql ├── _620.sql ├── _626.sql └── _627.sql ├── fishercoder_checkstyle.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── javascript ├── _1.js ├── _10.js ├── _1146.js ├── _1295.js ├── _1637.js ├── _1658.js ├── _1664.js ├── _167.js ├── _17.js ├── _2619.js ├── _2620.js ├── _2703.js ├── _3.js ├── _36.js ├── _485.js ├── _593.js └── _994.js ├── paginated_contents ├── algorithms │ ├── 1st_thousand │ │ └── README.md │ ├── 2nd_thousand │ │ └── README.md │ ├── 3rd_thousand │ │ └── README.md │ └── 4th_thousand │ │ └── README.md ├── database │ └── README.md ├── javascript │ └── README.md └── shell │ └── README.md ├── python3 ├── 2001.py └── 2879.py ├── settings.gradle ├── shell ├── TenthLine.sh ├── TransposeFile.sh ├── ValidPhoneNumbers.sh └── _192.sh └── src ├── main └── java │ └── com │ └── fishercoder │ ├── common │ ├── classes │ │ ├── BinaryMatrix.java │ │ ├── BinaryMatrixImpl.java │ │ ├── Employee.java │ │ ├── Interval.java │ │ ├── ListNode.java │ │ ├── NestedInteger.java │ │ ├── Node.java │ │ ├── Point.java │ │ ├── Reader4.java │ │ ├── TreeNode.java │ │ └── UndirectedGraphNode.java │ └── utils │ │ ├── ArrayUtils.java │ │ ├── BTreePrinter.java │ │ ├── CommonUtils.java │ │ ├── LinkedListUtils.java │ │ ├── Notes.java │ │ └── TreeUtils.java │ └── solutions │ ├── firstthousand │ ├── _1.java │ ├── _10.java │ ├── _100.java │ ├── _101.java │ ├── _102.java │ ├── _103.java │ ├── _104.java │ ├── _105.java │ ├── _106.java │ ├── _107.java │ ├── _108.java │ ├── _109.java │ ├── _11.java │ ├── _110.java │ ├── _111.java │ ├── _112.java │ ├── _113.java │ ├── _114.java │ ├── _115.java │ ├── _116.java │ ├── _117.java │ ├── _118.java │ ├── _119.java │ ├── _12.java │ ├── _120.java │ ├── _121.java │ ├── _122.java │ ├── _123.java │ ├── _124.java │ ├── _125.java │ ├── _126.java │ ├── _127.java │ ├── _128.java │ ├── _129.java │ ├── _13.java │ ├── _130.java │ ├── _131.java │ ├── _132.java │ ├── _133.java │ ├── _134.java │ ├── _135.java │ ├── _136.java │ ├── _137.java │ ├── _138.java │ ├── _139.java │ ├── _14.java │ ├── _140.java │ ├── _141.java │ ├── _142.java │ ├── _143.java │ ├── _144.java │ ├── _145.java │ ├── _146.java │ ├── _147.java │ ├── _148.java │ ├── _149.java │ ├── _15.java │ ├── _150.java │ ├── _151.java │ ├── _152.java │ ├── _153.java │ ├── _154.java │ ├── _155.java │ ├── _156.java │ ├── _157.java │ ├── _158.java │ ├── _159.java │ ├── _16.java │ ├── _160.java │ ├── _161.java │ ├── _162.java │ ├── _163.java │ ├── _164.java │ ├── _165.java │ ├── _166.java │ ├── _167.java │ ├── _168.java │ ├── _169.java │ ├── _17.java │ ├── _170.java │ ├── _171.java │ ├── _172.java │ ├── _173.java │ ├── _174.java │ ├── _179.java │ ├── _18.java │ ├── _186.java │ ├── _187.java │ ├── _188.java │ ├── _189.java │ ├── _19.java │ ├── _190.java │ ├── _191.java │ ├── _198.java │ ├── _199.java │ ├── _2.java │ ├── _20.java │ ├── _200.java │ ├── _201.java │ ├── _202.java │ ├── _203.java │ ├── _204.java │ ├── _205.java │ ├── _206.java │ ├── _207.java │ ├── _208.java │ ├── _209.java │ ├── _21.java │ ├── _210.java │ ├── _211.java │ ├── _212.java │ ├── _213.java │ ├── _214.java │ ├── _215.java │ ├── _216.java │ ├── _217.java │ ├── _218.java │ ├── _219.java │ ├── _22.java │ ├── _220.java │ ├── _221.java │ ├── _222.java │ ├── _223.java │ ├── _224.java │ ├── _225.java │ ├── _226.java │ ├── _227.java │ ├── _228.java │ ├── _229.java │ ├── _23.java │ ├── _230.java │ ├── _231.java │ ├── _232.java │ ├── _233.java │ ├── _234.java │ ├── _235.java │ ├── _236.java │ ├── _237.java │ ├── _238.java │ ├── _239.java │ ├── _24.java │ ├── _240.java │ ├── _241.java │ ├── _242.java │ ├── _243.java │ ├── _244.java │ ├── _245.java │ ├── _246.java │ ├── _247.java │ ├── _248.java │ ├── _249.java │ ├── _25.java │ ├── _250.java │ ├── _251.java │ ├── _252.java │ ├── _253.java │ ├── _254.java │ ├── _255.java │ ├── _256.java │ ├── _257.java │ ├── _258.java │ ├── _259.java │ ├── _26.java │ ├── _260.java │ ├── _261.java │ ├── _263.java │ ├── _264.java │ ├── _265.java │ ├── _266.java │ ├── _267.java │ ├── _268.java │ ├── _269.java │ ├── _27.java │ ├── _270.java │ ├── _271.java │ ├── _272.java │ ├── _273.java │ ├── _274.java │ ├── _275.java │ ├── _276.java │ ├── _277.java │ ├── _278.java │ ├── _279.java │ ├── _28.java │ ├── _280.java │ ├── _281.java │ ├── _282.java │ ├── _283.java │ ├── _284.java │ ├── _285.java │ ├── _286.java │ ├── _287.java │ ├── _288.java │ ├── _289.java │ ├── _29.java │ ├── _290.java │ ├── _291.java │ ├── _292.java │ ├── _293.java │ ├── _294.java │ ├── _295.java │ ├── _296.java │ ├── _297.java │ ├── _298.java │ ├── _299.java │ ├── _3.java │ ├── _30.java │ ├── _300.java │ ├── _301.java │ ├── _302.java │ ├── _303.java │ ├── _304.java │ ├── _305.java │ ├── _306.java │ ├── _307.java │ ├── _308.java │ ├── _309.java │ ├── _31.java │ ├── _310.java │ ├── _311.java │ ├── _312.java │ ├── _313.java │ ├── _314.java │ ├── _315.java │ ├── _316.java │ ├── _317.java │ ├── _318.java │ ├── _319.java │ ├── _32.java │ ├── _320.java │ ├── _321.java │ ├── _322.java │ ├── _323.java │ ├── _324.java │ ├── _325.java │ ├── _326.java │ ├── _327.java │ ├── _328.java │ ├── _329.java │ ├── _33.java │ ├── _330.java │ ├── _331.java │ ├── _332.java │ ├── _333.java │ ├── _334.java │ ├── _335.java │ ├── _336.java │ ├── _337.java │ ├── _338.java │ ├── _339.java │ ├── _34.java │ ├── _340.java │ ├── _341.java │ ├── _342.java │ ├── _343.java │ ├── _344.java │ ├── _345.java │ ├── _346.java │ ├── _347.java │ ├── _348.java │ ├── _349.java │ ├── _35.java │ ├── _350.java │ ├── _351.java │ ├── _352.java │ ├── _353.java │ ├── _354.java │ ├── _355.java │ ├── _356.java │ ├── _357.java │ ├── _358.java │ ├── _359.java │ ├── _36.java │ ├── _360.java │ ├── _361.java │ ├── _362.java │ ├── _363.java │ ├── _364.java │ ├── _365.java │ ├── _366.java │ ├── _367.java │ ├── _368.java │ ├── _369.java │ ├── _37.java │ ├── _370.java │ ├── _371.java │ ├── _372.java │ ├── _373.java │ ├── _374.java │ ├── _375.java │ ├── _376.java │ ├── _377.java │ ├── _378.java │ ├── _379.java │ ├── _38.java │ ├── _380.java │ ├── _381.java │ ├── _382.java │ ├── _383.java │ ├── _384.java │ ├── _385.java │ ├── _386.java │ ├── _387.java │ ├── _388.java │ ├── _389.java │ ├── _39.java │ ├── _390.java │ ├── _391.java │ ├── _392.java │ ├── _393.java │ ├── _394.java │ ├── _395.java │ ├── _396.java │ ├── _397.java │ ├── _398.java │ ├── _399.java │ ├── _4.java │ ├── _40.java │ ├── _400.java │ ├── _401.java │ ├── _402.java │ ├── _403.java │ ├── _404.java │ ├── _405.java │ ├── _406.java │ ├── _407.java │ ├── _408.java │ ├── _409.java │ ├── _41.java │ ├── _410.java │ ├── _411.java │ ├── _412.java │ ├── _413.java │ ├── _414.java │ ├── _415.java │ ├── _416.java │ ├── _417.java │ ├── _418.java │ ├── _419.java │ ├── _42.java │ ├── _420.java │ ├── _421.java │ ├── _422.java │ ├── _423.java │ ├── _424.java │ ├── _425.java │ ├── _426.java │ ├── _427.java │ ├── _429.java │ ├── _43.java │ ├── _430.java │ ├── _432.java │ ├── _433.java │ ├── _434.java │ ├── _435.java │ ├── _436.java │ ├── _437.java │ ├── _438.java │ ├── _439.java │ ├── _44.java │ ├── _440.java │ ├── _441.java │ ├── _442.java │ ├── _443.java │ ├── _444.java │ ├── _445.java │ ├── _446.java │ ├── _447.java │ ├── _448.java │ ├── _449.java │ ├── _45.java │ ├── _450.java │ ├── _451.java │ ├── _452.java │ ├── _453.java │ ├── _454.java │ ├── _455.java │ ├── _456.java │ ├── _457.java │ ├── _458.java │ ├── _459.java │ ├── _46.java │ ├── _460.java │ ├── _461.java │ ├── _462.java │ ├── _463.java │ ├── _464.java │ ├── _465.java │ ├── _466.java │ ├── _467.java │ ├── _468.java │ ├── _469.java │ ├── _47.java │ ├── _471.java │ ├── _472.java │ ├── _473.java │ ├── _474.java │ ├── _475.java │ ├── _476.java │ ├── _477.java │ ├── _478.java │ ├── _479.java │ ├── _48.java │ ├── _480.java │ ├── _481.java │ ├── _482.java │ ├── _483.java │ ├── _484.java │ ├── _485.java │ ├── _486.java │ ├── _487.java │ ├── _488.java │ ├── _49.java │ ├── _490.java │ ├── _491.java │ ├── _492.java │ ├── _493.java │ ├── _494.java │ ├── _495.java │ ├── _496.java │ ├── _498.java │ ├── _499.java │ ├── _5.java │ ├── _50.java │ ├── _500.java │ ├── _501.java │ ├── _502.java │ ├── _503.java │ ├── _504.java │ ├── _505.java │ ├── _506.java │ ├── _507.java │ ├── _508.java │ ├── _509.java │ ├── _51.java │ ├── _513.java │ ├── _514.java │ ├── _515.java │ ├── _516.java │ ├── _517.java │ ├── _518.java │ ├── _519.java │ ├── _52.java │ ├── _520.java │ ├── _521.java │ ├── _522.java │ ├── _523.java │ ├── _524.java │ ├── _525.java │ ├── _526.java │ ├── _527.java │ ├── _528.java │ ├── _529.java │ ├── _53.java │ ├── _530.java │ ├── _531.java │ ├── _532.java │ ├── _533.java │ ├── _535.java │ ├── _536.java │ ├── _537.java │ ├── _538.java │ ├── _539.java │ ├── _54.java │ ├── _540.java │ ├── _541.java │ ├── _542.java │ ├── _543.java │ ├── _544.java │ ├── _545.java │ ├── _546.java │ ├── _547.java │ ├── _548.java │ ├── _549.java │ ├── _55.java │ ├── _551.java │ ├── _552.java │ ├── _553.java │ ├── _554.java │ ├── _555.java │ ├── _556.java │ ├── _557.java │ ├── _559.java │ ├── _56.java │ ├── _560.java │ ├── _561.java │ ├── _562.java │ ├── _563.java │ ├── _564.java │ ├── _565.java │ ├── _566.java │ ├── _567.java │ ├── _568.java │ ├── _57.java │ ├── _572.java │ ├── _573.java │ ├── _575.java │ ├── _576.java │ ├── _58.java │ ├── _581.java │ ├── _582.java │ ├── _583.java │ ├── _587.java │ ├── _588.java │ ├── _589.java │ ├── _59.java │ ├── _590.java │ ├── _591.java │ ├── _592.java │ ├── _593.java │ ├── _594.java │ ├── _598.java │ ├── _599.java │ ├── _6.java │ ├── _60.java │ ├── _600.java │ ├── _604.java │ ├── _605.java │ ├── _606.java │ ├── _609.java │ ├── _61.java │ ├── _611.java │ ├── _616.java │ ├── _617.java │ ├── _62.java │ ├── _621.java │ ├── _622.java │ ├── _623.java │ ├── _624.java │ ├── _625.java │ ├── _628.java │ ├── _629.java │ ├── _63.java │ ├── _630.java │ ├── _631.java │ ├── _632.java │ ├── _633.java │ ├── _634.java │ ├── _635.java │ ├── _636.java │ ├── _637.java │ ├── _638.java │ ├── _639.java │ ├── _64.java │ ├── _640.java │ ├── _642.java │ ├── _643.java │ ├── _644.java │ ├── _645.java │ ├── _646.java │ ├── _647.java │ ├── _648.java │ ├── _649.java │ ├── _65.java │ ├── _650.java │ ├── _651.java │ ├── _652.java │ ├── _653.java │ ├── _654.java │ ├── _655.java │ ├── _656.java │ ├── _657.java │ ├── _658.java │ ├── _659.java │ ├── _66.java │ ├── _660.java │ ├── _661.java │ ├── _662.java │ ├── _663.java │ ├── _664.java │ ├── _665.java │ ├── _666.java │ ├── _667.java │ ├── _668.java │ ├── _669.java │ ├── _67.java │ ├── _670.java │ ├── _671.java │ ├── _672.java │ ├── _673.java │ ├── _674.java │ ├── _675.java │ ├── _676.java │ ├── _677.java │ ├── _678.java │ ├── _679.java │ ├── _68.java │ ├── _680.java │ ├── _681.java │ ├── _682.java │ ├── _683.java │ ├── _684.java │ ├── _685.java │ ├── _686.java │ ├── _687.java │ ├── _688.java │ ├── _689.java │ ├── _69.java │ ├── _690.java │ ├── _691.java │ ├── _692.java │ ├── _693.java │ ├── _694.java │ ├── _695.java │ ├── _696.java │ ├── _697.java │ ├── _698.java │ ├── _699.java │ ├── _7.java │ ├── _70.java │ ├── _700.java │ ├── _701.java │ ├── _703.java │ ├── _704.java │ ├── _705.java │ ├── _706.java │ ├── _708.java │ ├── _709.java │ ├── _71.java │ ├── _712.java │ ├── _713.java │ ├── _714.java │ ├── _716.java │ ├── _717.java │ ├── _718.java │ ├── _719.java │ ├── _72.java │ ├── _720.java │ ├── _721.java │ ├── _722.java │ ├── _723.java │ ├── _724.java │ ├── _725.java │ ├── _726.java │ ├── _727.java │ ├── _728.java │ ├── _729.java │ ├── _73.java │ ├── _733.java │ ├── _734.java │ ├── _735.java │ ├── _737.java │ ├── _738.java │ ├── _739.java │ ├── _74.java │ ├── _740.java │ ├── _742.java │ ├── _743.java │ ├── _744.java │ ├── _746.java │ ├── _747.java │ ├── _748.java │ ├── _749.java │ ├── _75.java │ ├── _750.java │ ├── _751.java │ ├── _752.java │ ├── _754.java │ ├── _755.java │ ├── _756.java │ ├── _757.java │ ├── _758.java │ ├── _76.java │ ├── _760.java │ ├── _762.java │ ├── _763.java │ ├── _764.java │ ├── _765.java │ ├── _766.java │ ├── _767.java │ ├── _769.java │ ├── _77.java │ ├── _771.java │ ├── _773.java │ ├── _775.java │ ├── _776.java │ ├── _777.java │ ├── _779.java │ ├── _78.java │ ├── _781.java │ ├── _783.java │ ├── _784.java │ ├── _785.java │ ├── _788.java │ ├── _789.java │ ├── _79.java │ ├── _791.java │ ├── _792.java │ ├── _796.java │ ├── _799.java │ ├── _8.java │ ├── _80.java │ ├── _800.java │ ├── _802.java │ ├── _804.java │ ├── _806.java │ ├── _807.java │ ├── _809.java │ ├── _81.java │ ├── _811.java │ ├── _812.java │ ├── _814.java │ ├── _816.java │ ├── _819.java │ ├── _82.java │ ├── _820.java │ ├── _821.java │ ├── _823.java │ ├── _824.java │ ├── _826.java │ ├── _83.java │ ├── _830.java │ ├── _832.java │ ├── _836.java │ ├── _838.java │ ├── _84.java │ ├── _840.java │ ├── _841.java │ ├── _844.java │ ├── _847.java │ ├── _848.java │ ├── _849.java │ ├── _85.java │ ├── _851.java │ ├── _852.java │ ├── _856.java │ ├── _859.java │ ├── _86.java │ ├── _860.java │ ├── _861.java │ ├── _863.java │ ├── _867.java │ ├── _868.java │ ├── _87.java │ ├── _870.java │ ├── _872.java │ ├── _875.java │ ├── _876.java │ ├── _877.java │ ├── _88.java │ ├── _880.java │ ├── _881.java │ ├── _883.java │ ├── _884.java │ ├── _885.java │ ├── _888.java │ ├── _89.java │ ├── _890.java │ ├── _892.java │ ├── _893.java │ ├── _895.java │ ├── _896.java │ ├── _897.java │ ├── _9.java │ ├── _90.java │ ├── _900.java │ ├── _901.java │ ├── _904.java │ ├── _905.java │ ├── _908.java │ ├── _91.java │ ├── _912.java │ ├── _914.java │ ├── _917.java │ ├── _918.java │ ├── _919.java │ ├── _92.java │ ├── _921.java │ ├── _922.java │ ├── _923.java │ ├── _925.java │ ├── _929.java │ ├── _93.java │ ├── _931.java │ ├── _933.java │ ├── _934.java │ ├── _935.java │ ├── _936.java │ ├── _937.java │ ├── _938.java │ ├── _94.java │ ├── _941.java │ ├── _942.java │ ├── _944.java │ ├── _945.java │ ├── _946.java │ ├── _95.java │ ├── _950.java │ ├── _951.java │ ├── _953.java │ ├── _954.java │ ├── _957.java │ ├── _958.java │ ├── _96.java │ ├── _961.java │ ├── _965.java │ ├── _966.java │ ├── _97.java │ ├── _970.java │ ├── _973.java │ ├── _974.java │ ├── _976.java │ ├── _977.java │ ├── _979.java │ ├── _98.java │ ├── _980.java │ ├── _981.java │ ├── _985.java │ ├── _986.java │ ├── _987.java │ ├── _988.java │ ├── _989.java │ ├── _99.java │ ├── _991.java │ ├── _993.java │ ├── _994.java │ ├── _997.java │ └── _999.java │ ├── fourththousand │ ├── _3000.java │ ├── _3004.java │ ├── _3005.java │ ├── _3006.java │ ├── _3010.java │ ├── _3014.java │ ├── _3016.java │ ├── _3019.java │ ├── _3024.java │ ├── _3028.java │ ├── _3032.java │ ├── _3033.java │ ├── _3038.java │ ├── _3042.java │ ├── _3046.java │ ├── _3062.java │ ├── _3063.java │ ├── _3065.java │ ├── _3069.java │ ├── _3074.java │ ├── _3079.java │ ├── _3083.java │ ├── _3090.java │ ├── _3095.java │ ├── _3099.java │ ├── _3110.java │ ├── _3112.java │ ├── _3114.java │ ├── _3120.java │ ├── _3127.java │ ├── _3131.java │ ├── _3136.java │ ├── _3142.java │ ├── _3146.java │ ├── _3151.java │ ├── _3157.java │ ├── _3158.java │ ├── _3162.java │ ├── _3164.java │ ├── _3168.java │ ├── _3173.java │ ├── _3174.java │ ├── _3175.java │ ├── _3178.java │ ├── _3184.java │ ├── _3185.java │ ├── _3186.java │ ├── _3189.java │ ├── _3190.java │ ├── _3191.java │ ├── _3192.java │ ├── _3194.java │ ├── _3195.java │ ├── _3196.java │ ├── _3199.java │ ├── _3200.java │ ├── _3206.java │ ├── _3208.java │ ├── _3210.java │ ├── _3211.java │ ├── _3212.java │ ├── _3216.java │ ├── _3217.java │ ├── _3218.java │ ├── _3219.java │ ├── _3222.java │ ├── _3223.java │ ├── _3224.java │ ├── _3226.java │ ├── _3228.java │ ├── _3232.java │ ├── _3233.java │ ├── _3234.java │ ├── _3237.java │ ├── _3238.java │ ├── _3239.java │ ├── _3240.java │ ├── _3241.java │ ├── _3242.java │ ├── _3243.java │ ├── _3248.java │ ├── _3249.java │ ├── _3254.java │ ├── _3258.java │ ├── _3263.java │ ├── _3264.java │ ├── _3270.java │ ├── _3274.java │ ├── _3280.java │ ├── _3285.java │ ├── _3289.java │ ├── _3300.java │ ├── _3304.java │ ├── _3314.java │ ├── _3318.java │ ├── _3324.java │ ├── _3330.java │ ├── _3340.java │ ├── _3345.java │ ├── _3349.java │ ├── _3353.java │ ├── _3354.java │ ├── _3360.java │ ├── _3364.java │ ├── _3370.java │ ├── _3375.java │ ├── _3379.java │ ├── _3386.java │ ├── _3392.java │ ├── _3396.java │ ├── _3402.java │ ├── _3471.java │ ├── _3477.java │ ├── _3491.java │ └── _3502.java │ ├── secondthousand │ ├── _1002.java │ ├── _1003.java │ ├── _1004.java │ ├── _1005.java │ ├── _1008.java │ ├── _1009.java │ ├── _1010.java │ ├── _1011.java │ ├── _1013.java │ ├── _1014.java │ ├── _1018.java │ ├── _1019.java │ ├── _1020.java │ ├── _1021.java │ ├── _1022.java │ ├── _1024.java │ ├── _1025.java │ ├── _1026.java │ ├── _1029.java │ ├── _1030.java │ ├── _1033.java │ ├── _1034.java │ ├── _1037.java │ ├── _1038.java │ ├── _1043.java │ ├── _1046.java │ ├── _1047.java │ ├── _1049.java │ ├── _1051.java │ ├── _1055.java │ ├── _1056.java │ ├── _1057.java │ ├── _1059.java │ ├── _1060.java │ ├── _1061.java │ ├── _1062.java │ ├── _1065.java │ ├── _1066.java │ ├── _1071.java │ ├── _1078.java │ ├── _1079.java │ ├── _1080.java │ ├── _1085.java │ ├── _1086.java │ ├── _1087.java │ ├── _1089.java │ ├── _1090.java │ ├── _1091.java │ ├── _1094.java │ ├── _1099.java │ ├── _1100.java │ ├── _1103.java │ ├── _1104.java │ ├── _1105.java │ ├── _1108.java │ ├── _1110.java │ ├── _1114.java │ ├── _1118.java │ ├── _1119.java │ ├── _1120.java │ ├── _1122.java │ ├── _1123.java │ ├── _1128.java │ ├── _1133.java │ ├── _1134.java │ ├── _1136.java │ ├── _1137.java │ ├── _1138.java │ ├── _1143.java │ ├── _1145.java │ ├── _1146.java │ ├── _1150.java │ ├── _1151.java │ ├── _1152.java │ ├── _1154.java │ ├── _1160.java │ ├── _1161.java │ ├── _1165.java │ ├── _1170.java │ ├── _1171.java │ ├── _1175.java │ ├── _1176.java │ ├── _1180.java │ ├── _1182.java │ ├── _1184.java │ ├── _1185.java │ ├── _1186.java │ ├── _1189.java │ ├── _1190.java │ ├── _1196.java │ ├── _1197.java │ ├── _1198.java │ ├── _1200.java │ ├── _1207.java │ ├── _1209.java │ ├── _1213.java │ ├── _1214.java │ ├── _1217.java │ ├── _1219.java │ ├── _1221.java │ ├── _1228.java │ ├── _1230.java │ ├── _1232.java │ ├── _1233.java │ ├── _1237.java │ ├── _1242.java │ ├── _1243.java │ ├── _1248.java │ ├── _1249.java │ ├── _1252.java │ ├── _1254.java │ ├── _1257.java │ ├── _1258.java │ ├── _1260.java │ ├── _1261.java │ ├── _1265.java │ ├── _1266.java │ ├── _1267.java │ ├── _1268.java │ ├── _1271.java │ ├── _1273.java │ ├── _1275.java │ ├── _1277.java │ ├── _1281.java │ ├── _1282.java │ ├── _1283.java │ ├── _1286.java │ ├── _1287.java │ ├── _1289.java │ ├── _1290.java │ ├── _1291.java │ ├── _1295.java │ ├── _1296.java │ ├── _1297.java │ ├── _1299.java │ ├── _1300.java │ ├── _1302.java │ ├── _1304.java │ ├── _1305.java │ ├── _1309.java │ ├── _1313.java │ ├── _1314.java │ ├── _1315.java │ ├── _1317.java │ ├── _1323.java │ ├── _1324.java │ ├── _1325.java │ ├── _1329.java │ ├── _1331.java │ ├── _1332.java │ ├── _1333.java │ ├── _1334.java │ ├── _1337.java │ ├── _1338.java │ ├── _1339.java │ ├── _1341.java │ ├── _1342.java │ ├── _1343.java │ ├── _1344.java │ ├── _1345.java │ ├── _1346.java │ ├── _1347.java │ ├── _1348.java │ ├── _1349.java │ ├── _1351.java │ ├── _1352.java │ ├── _1353.java │ ├── _1354.java │ ├── _1356.java │ ├── _1357.java │ ├── _1358.java │ ├── _1360.java │ ├── _1361.java │ ├── _1362.java │ ├── _1365.java │ ├── _1366.java │ ├── _1367.java │ ├── _1370.java │ ├── _1371.java │ ├── _1372.java │ ├── _1373.java │ ├── _1374.java │ ├── _1375.java │ ├── _1376.java │ ├── _1377.java │ ├── _1379.java │ ├── _1380.java │ ├── _1381.java │ ├── _1382.java │ ├── _1385.java │ ├── _1386.java │ ├── _1387.java │ ├── _1388.java │ ├── _1389.java │ ├── _1390.java │ ├── _1392.java │ ├── _1394.java │ ├── _1395.java │ ├── _1396.java │ ├── _1399.java │ ├── _1400.java │ ├── _1401.java │ ├── _1403.java │ ├── _1405.java │ ├── _1408.java │ ├── _1409.java │ ├── _1410.java │ ├── _1413.java │ ├── _1414.java │ ├── _1415.java │ ├── _1417.java │ ├── _1418.java │ ├── _1422.java │ ├── _1423.java │ ├── _1424.java │ ├── _1426.java │ ├── _1427.java │ ├── _1428.java │ ├── _1429.java │ ├── _1431.java │ ├── _1432.java │ ├── _1436.java │ ├── _1437.java │ ├── _1438.java │ ├── _1439.java │ ├── _1441.java │ ├── _1446.java │ ├── _1447.java │ ├── _1448.java │ ├── _1450.java │ ├── _1451.java │ ├── _1452.java │ ├── _1455.java │ ├── _1456.java │ ├── _1457.java │ ├── _1460.java │ ├── _1461.java │ ├── _1462.java │ ├── _1464.java │ ├── _1466.java │ ├── _1469.java │ ├── _1470.java │ ├── _1471.java │ ├── _1472.java │ ├── _1474.java │ ├── _1475.java │ ├── _1476.java │ ├── _1480.java │ ├── _1481.java │ ├── _1482.java │ ├── _1485.java │ ├── _1486.java │ ├── _1487.java │ ├── _1490.java │ ├── _1491.java │ ├── _1492.java │ ├── _1493.java │ ├── _1496.java │ ├── _1502.java │ ├── _1507.java │ ├── _1508.java │ ├── _1509.java │ ├── _1512.java │ ├── _1514.java │ ├── _1518.java │ ├── _1523.java │ ├── _1524.java │ ├── _1525.java │ ├── _1526.java │ ├── _1528.java │ ├── _1530.java │ ├── _1534.java │ ├── _1535.java │ ├── _1539.java │ ├── _1541.java │ ├── _1544.java │ ├── _1545.java │ ├── _1550.java │ ├── _1551.java │ ├── _1556.java │ ├── _1557.java │ ├── _1558.java │ ├── _1560.java │ ├── _1561.java │ ├── _1566.java │ ├── _1567.java │ ├── _1570.java │ ├── _1572.java │ ├── _1574.java │ ├── _1576.java │ ├── _1577.java │ ├── _1582.java │ ├── _1583.java │ ├── _1588.java │ ├── _1592.java │ ├── _1598.java │ ├── _1600.java │ ├── _1601.java │ ├── _1602.java │ ├── _1603.java │ ├── _1604.java │ ├── _1605.java │ ├── _1608.java │ ├── _1609.java │ ├── _1614.java │ ├── _1619.java │ ├── _1620.java │ ├── _1624.java │ ├── _1625.java │ ├── _1626.java │ ├── _1628.java │ ├── _1629.java │ ├── _1630.java │ ├── _1636.java │ ├── _1637.java │ ├── _1640.java │ ├── _1641.java │ ├── _1642.java │ ├── _1644.java │ ├── _1646.java │ ├── _1650.java │ ├── _1652.java │ ├── _1653.java │ ├── _1656.java │ ├── _1657.java │ ├── _1658.java │ ├── _1660.java │ ├── _1662.java │ ├── _1663.java │ ├── _1668.java │ ├── _1669.java │ ├── _1670.java │ ├── _1672.java │ ├── _1673.java │ ├── _1675.java │ ├── _1676.java │ ├── _1678.java │ ├── _1679.java │ ├── _1680.java │ ├── _1684.java │ ├── _1685.java │ ├── _1686.java │ ├── _1688.java │ ├── _1689.java │ ├── _1690.java │ ├── _1694.java │ ├── _1695.java │ ├── _1700.java │ ├── _1701.java │ ├── _1704.java │ ├── _1705.java │ ├── _1708.java │ ├── _1710.java │ ├── _1711.java │ ├── _1716.java │ ├── _1717.java │ ├── _1718.java │ ├── _1720.java │ ├── _1721.java │ ├── _1725.java │ ├── _1726.java │ ├── _1727.java │ ├── _1730.java │ ├── _1732.java │ ├── _1733.java │ ├── _1736.java │ ├── _1740.java │ ├── _1742.java │ ├── _1743.java │ ├── _1745.java │ ├── _1746.java │ ├── _1748.java │ ├── _1749.java │ ├── _1750.java │ ├── _1752.java │ ├── _1753.java │ ├── _1754.java │ ├── _1756.java │ ├── _1758.java │ ├── _1759.java │ ├── _1762.java │ ├── _1763.java │ ├── _1764.java │ ├── _1765.java │ ├── _1768.java │ ├── _1769.java │ ├── _1772.java │ ├── _1773.java │ ├── _1774.java │ ├── _1775.java │ ├── _1779.java │ ├── _1780.java │ ├── _1781.java │ ├── _1784.java │ ├── _1785.java │ ├── _1790.java │ ├── _1791.java │ ├── _1792.java │ ├── _1796.java │ ├── _1797.java │ ├── _1800.java │ ├── _1804.java │ ├── _1805.java │ ├── _1806.java │ ├── _1807.java │ ├── _1812.java │ ├── _1813.java │ ├── _1814.java │ ├── _1816.java │ ├── _1817.java │ ├── _1822.java │ ├── _1823.java │ ├── _1826.java │ ├── _1827.java │ ├── _1828.java │ ├── _1829.java │ ├── _1832.java │ ├── _1833.java │ ├── _1836.java │ ├── _1837.java │ ├── _1844.java │ ├── _1845.java │ ├── _1848.java │ ├── _1854.java │ ├── _1859.java │ ├── _1860.java │ ├── _1861.java │ ├── _1862.java │ ├── _1863.java │ ├── _1868.java │ ├── _1869.java │ ├── _1874.java │ ├── _1876.java │ ├── _1877.java │ ├── _1880.java │ ├── _1886.java │ ├── _1891.java │ ├── _1893.java │ ├── _1894.java │ ├── _1897.java │ ├── _1899.java │ ├── _1903.java │ ├── _1904.java │ ├── _1909.java │ ├── _1910.java │ ├── _1913.java │ ├── _1920.java │ ├── _1925.java │ ├── _1926.java │ ├── _1929.java │ ├── _1933.java │ ├── _1935.java │ ├── _1936.java │ ├── _1941.java │ ├── _1945.java │ ├── _1952.java │ ├── _1957.java │ ├── _1961.java │ ├── _1966.java │ ├── _1967.java │ ├── _1968.java │ ├── _1971.java │ ├── _1973.java │ ├── _1974.java │ ├── _1979.java │ ├── _1980.java │ ├── _1981.java │ ├── _1984.java │ ├── _1985.java │ ├── _1991.java │ ├── _1992.java │ ├── _1993.java │ ├── _1995.java │ └── _1996.java │ └── thirdthousand │ ├── _2000.java │ ├── _2001.java │ ├── _2006.java │ ├── _2007.java │ ├── _2011.java │ ├── _2012.java │ ├── _2016.java │ ├── _2017.java │ ├── _2018.java │ ├── _2022.java │ ├── _2023.java │ ├── _2024.java │ ├── _2027.java │ ├── _2028.java │ ├── _2032.java │ ├── _2033.java │ ├── _2034.java │ ├── _2037.java │ ├── _2038.java │ ├── _2039.java │ ├── _2042.java │ ├── _2043.java │ ├── _2044.java │ ├── _2047.java │ ├── _2048.java │ ├── _2049.java │ ├── _2050.java │ ├── _2053.java │ ├── _2054.java │ ├── _2055.java │ ├── _2057.java │ ├── _2058.java │ ├── _2062.java │ ├── _2063.java │ ├── _2068.java │ ├── _2070.java │ ├── _2073.java │ ├── _2074.java │ ├── _2075.java │ ├── _2076.java │ ├── _2078.java │ ├── _2079.java │ ├── _2080.java │ ├── _2085.java │ ├── _2086.java │ ├── _2089.java │ ├── _2090.java │ ├── _2091.java │ ├── _2094.java │ ├── _2095.java │ ├── _2096.java │ ├── _2099.java │ ├── _2103.java │ ├── _2108.java │ ├── _2109.java │ ├── _2110.java │ ├── _2114.java │ ├── _2115.java │ ├── _2116.java │ ├── _2119.java │ ├── _2120.java │ ├── _2124.java │ ├── _2125.java │ ├── _2126.java │ ├── _2129.java │ ├── _2130.java │ ├── _2133.java │ ├── _2134.java │ ├── _2135.java │ ├── _2138.java │ ├── _2139.java │ ├── _2144.java │ ├── _2148.java │ ├── _2149.java │ ├── _2150.java │ ├── _2154.java │ ├── _2155.java │ ├── _2156.java │ ├── _2160.java │ ├── _2161.java │ ├── _2164.java │ ├── _2165.java │ ├── _2166.java │ ├── _2169.java │ ├── _2176.java │ ├── _2177.java │ ├── _2180.java │ ├── _2181.java │ ├── _2182.java │ ├── _2185.java │ ├── _2186.java │ ├── _2190.java │ ├── _2191.java │ ├── _2192.java │ ├── _2194.java │ ├── _2196.java │ ├── _2200.java │ ├── _2201.java │ ├── _2206.java │ ├── _2208.java │ ├── _2210.java │ ├── _2215.java │ ├── _2220.java │ ├── _2224.java │ ├── _2229.java │ ├── _2231.java │ ├── _2235.java │ ├── _2236.java │ ├── _2239.java │ ├── _2243.java │ ├── _2244.java │ ├── _2248.java │ ├── _2255.java │ ├── _2256.java │ ├── _2259.java │ ├── _2260.java │ ├── _2264.java │ ├── _2265.java │ ├── _2269.java │ ├── _2270.java │ ├── _2273.java │ ├── _2278.java │ ├── _2279.java │ ├── _2283.java │ ├── _2284.java │ ├── _2287.java │ ├── _2288.java │ ├── _2293.java │ ├── _2299.java │ ├── _2300.java │ ├── _2303.java │ ├── _2309.java │ ├── _2315.java │ ├── _2316.java │ ├── _2319.java │ ├── _2325.java │ ├── _2326.java │ ├── _2331.java │ ├── _2335.java │ ├── _2340.java │ ├── _2341.java │ ├── _2347.java │ ├── _2351.java │ ├── _2352.java │ ├── _2357.java │ ├── _2363.java │ ├── _2367.java │ ├── _2373.java │ ├── _2379.java │ ├── _2380.java │ ├── _2385.java │ ├── _2389.java │ ├── _2392.java │ ├── _2395.java │ ├── _2399.java │ ├── _2404.java │ ├── _2409.java │ ├── _2413.java │ ├── _2418.java │ ├── _2423.java │ ├── _2427.java │ ├── _2432.java │ ├── _2433.java │ ├── _2437.java │ ├── _2441.java │ ├── _2446.java │ ├── _2451.java │ ├── _2455.java │ ├── _2460.java │ ├── _2465.java │ ├── _2469.java │ ├── _2473.java │ ├── _2475.java │ ├── _2481.java │ ├── _2485.java │ ├── _2487.java │ ├── _2490.java │ ├── _2492.java │ ├── _2496.java │ ├── _2500.java │ ├── _2501.java │ ├── _2506.java │ ├── _2511.java │ ├── _2515.java │ ├── _2520.java │ ├── _2525.java │ ├── _2529.java │ ├── _2530.java │ ├── _2535.java │ ├── _2536.java │ ├── _2540.java │ ├── _2544.java │ ├── _2549.java │ ├── _2553.java │ ├── _2554.java │ ├── _2558.java │ ├── _2559.java │ ├── _2562.java │ ├── _2566.java │ ├── _2570.java │ ├── _2574.java │ ├── _2578.java │ ├── _2582.java │ ├── _2583.java │ ├── _2586.java │ ├── _2591.java │ ├── _2595.java │ ├── _2596.java │ ├── _2600.java │ ├── _2605.java │ ├── _2609.java │ ├── _2614.java │ ├── _2639.java │ ├── _2641.java │ ├── _2643.java │ ├── _2644.java │ ├── _2651.java │ ├── _2652.java │ ├── _2656.java │ ├── _2660.java │ ├── _2670.java │ ├── _2673.java │ ├── _2678.java │ ├── _2682.java │ ├── _2689.java │ ├── _2696.java │ ├── _2697.java │ ├── _2706.java │ ├── _2710.java │ ├── _2716.java │ ├── _2717.java │ ├── _2728.java │ ├── _2729.java │ ├── _2733.java │ ├── _2739.java │ ├── _2744.java │ ├── _2748.java │ ├── _2751.java │ ├── _2760.java │ ├── _2765.java │ ├── _2769.java │ ├── _2778.java │ ├── _2784.java │ ├── _2788.java │ ├── _2798.java │ ├── _2806.java │ ├── _2810.java │ ├── _2812.java │ ├── _2815.java │ ├── _2824.java │ ├── _2828.java │ ├── _2833.java │ ├── _2839.java │ ├── _2843.java │ ├── _2848.java │ ├── _2855.java │ ├── _2859.java │ ├── _2864.java │ ├── _2869.java │ ├── _2873.java │ ├── _2894.java │ ├── _2899.java │ ├── _2900.java │ ├── _2903.java │ ├── _2908.java │ ├── _2913.java │ ├── _2917.java │ ├── _2923.java │ ├── _2928.java │ ├── _2932.java │ ├── _2937.java │ ├── _2942.java │ ├── _2946.java │ ├── _2951.java │ ├── _2956.java │ ├── _2960.java │ ├── _2965.java │ ├── _2970.java │ ├── _2974.java │ ├── _2976.java │ ├── _2980.java │ └── _2996.java └── test ├── java └── com │ └── fishercoder │ ├── firstthousand │ ├── _100Test.java │ ├── _101Test.java │ ├── _102Test.java │ ├── _103Test.java │ ├── _104Test.java │ ├── _105Test.java │ ├── _106Test.java │ ├── _107Test.java │ ├── _108Test.java │ ├── _109Test.java │ ├── _10Test.java │ ├── _110Test.java │ ├── _113Test.java │ ├── _114Test.java │ ├── _115Test.java │ ├── _116Test.java │ ├── _117Test.java │ ├── _118Test.java │ ├── _119Test.java │ ├── _11Test.java │ ├── _120Test.java │ ├── _121Test.java │ ├── _122Test.java │ ├── _123Test.java │ ├── _125Test.java │ ├── _127Test.java │ ├── _128Test.java │ ├── _129Test.java │ ├── _12Test.java │ ├── _130Test.java │ ├── _131Test.java │ ├── _132Test.java │ ├── _133Test.java │ ├── _134Test.java │ ├── _136Test.java │ ├── _139Test.java │ ├── _13Test.java │ ├── _140Test.java │ ├── _141Test.java │ ├── _143Test.java │ ├── _144Test.java │ ├── _145Test.java │ ├── _148Test.java │ ├── _149Test.java │ ├── _14Test.java │ ├── _150Test.java │ ├── _151Test.java │ ├── _153Test.java │ ├── _154Test.java │ ├── _155Test.java │ ├── _156Test.java │ ├── _159Test.java │ ├── _15Test.java │ ├── _160Test.java │ ├── _161Test.java │ ├── _162Test.java │ ├── _163Test.java │ ├── _164Test.java │ ├── _165Test.java │ ├── _166Test.java │ ├── _167Test.java │ ├── _168Test.java │ ├── _169Test.java │ ├── _16Test.java │ ├── _171Test.java │ ├── _174Test.java │ ├── _179Test.java │ ├── _17Test.java │ ├── _186Test.java │ ├── _187Test.java │ ├── _189Test.java │ ├── _18Test.java │ ├── _190Test.java │ ├── _191Test.java │ ├── _198Test.java │ ├── _199Test.java │ ├── _19Test.java │ ├── _1Test.java │ ├── _200Test.java │ ├── _201Test.java │ ├── _202Test.java │ ├── _203Test.java │ ├── _204Test.java │ ├── _206Test.java │ ├── _207Test.java │ ├── _208Test.java │ ├── _209Test.java │ ├── _20Test.java │ ├── _210Test.java │ ├── _211Test.java │ ├── _212Test.java │ ├── _213Test.java │ ├── _215Test.java │ ├── _216Test.java │ ├── _217Test.java │ ├── _219Test.java │ ├── _21Test.java │ ├── _220Test.java │ ├── _221Test.java │ ├── _222Test.java │ ├── _224Test.java │ ├── _227Test.java │ ├── _228Test.java │ ├── _229Test.java │ ├── _22Test.java │ ├── _230Test.java │ ├── _234Test.java │ ├── _235Test.java │ ├── _237Test.java │ ├── _238Test.java │ ├── _239Test.java │ ├── _23Test.java │ ├── _240Test.java │ ├── _242Test.java │ ├── _247Test.java │ ├── _249Test.java │ ├── _24Test.java │ ├── _256Test.java │ ├── _25Test.java │ ├── _264Test.java │ ├── _269Test.java │ ├── _26Test.java │ ├── _270Test.java │ ├── _273Test.java │ ├── _276Test.java │ ├── _279Test.java │ ├── _27Test.java │ ├── _283Test.java │ ├── _289Test.java │ ├── _28Test.java │ ├── _291Test.java │ ├── _294Test.java │ ├── _295Test.java │ ├── _297Test.java │ ├── _298Test.java │ ├── _29Test.java │ ├── _2Test.java │ ├── _300Test.java │ ├── _304Test.java │ ├── _306Test.java │ ├── _30Test.java │ ├── _312Test.java │ ├── _316Test.java │ ├── _319Test.java │ ├── _31Test.java │ ├── _320Test.java │ ├── _325Test.java │ ├── _326Test.java │ ├── _327Test.java │ ├── _328Test.java │ ├── _32Test.java │ ├── _330Test.java │ ├── _331Test.java │ ├── _332Test.java │ ├── _334Test.java │ ├── _337Test.java │ ├── _338Test.java │ ├── _33Test.java │ ├── _340Test.java │ ├── _341Test.java │ ├── _347Test.java │ ├── _348Test.java │ ├── _349Test.java │ ├── _34Test.java │ ├── _350Test.java │ ├── _351Test.java │ ├── _352Test.java │ ├── _355Test.java │ ├── _356Test.java │ ├── _358Test.java │ ├── _35Test.java │ ├── _362Test.java │ ├── _368Test.java │ ├── _369Test.java │ ├── _36Test.java │ ├── _370Test.java │ ├── _372Test.java │ ├── _376Test.java │ ├── _377Test.java │ ├── _378Test.java │ ├── _37Test.java │ ├── _381Test.java │ ├── _384Test.java │ ├── _385Test.java │ ├── _388Test.java │ ├── _38Test.java │ ├── _392Test.java │ ├── _393Test.java │ ├── _394Test.java │ ├── _395Test.java │ ├── _396Test.java │ ├── _397Test.java │ ├── _39Test.java │ ├── _3Test.java │ ├── _400Test.java │ ├── _401Test.java │ ├── _402Test.java │ ├── _404Test.java │ ├── _406Test.java │ ├── _408Test.java │ ├── _409Test.java │ ├── _40Test.java │ ├── _410Test.java │ ├── _415Test.java │ ├── _416Test.java │ ├── _417Test.java │ ├── _418Test.java │ ├── _41Test.java │ ├── _421Test.java │ ├── _422Test.java │ ├── _423Test.java │ ├── _424Test.java │ ├── _425Test.java │ ├── _426Test.java │ ├── _429Test.java │ ├── _42Test.java │ ├── _433Test.java │ ├── _434Test.java │ ├── _435Test.java │ ├── _436Test.java │ ├── _439Test.java │ ├── _43Test.java │ ├── _441Test.java │ ├── _442Test.java │ ├── _443Test.java │ ├── _444Test.java │ ├── _445Test.java │ ├── _447Test.java │ ├── _449Test.java │ ├── _44Test.java │ ├── _450Test.java │ ├── _451Test.java │ ├── _452Test.java │ ├── _453Test.java │ ├── _454Test.java │ ├── _455Test.java │ ├── _456Test.java │ ├── _457Test.java │ ├── _458Test.java │ ├── _459Test.java │ ├── _45Test.java │ ├── _460Test.java │ ├── _461Test.java │ ├── _462Test.java │ ├── _467Test.java │ ├── _468Test.java │ ├── _46Test.java │ ├── _473Test.java │ ├── _474Test.java │ ├── _475Test.java │ ├── _476Test.java │ ├── _478Test.java │ ├── _479Test.java │ ├── _47Test.java │ ├── _480Test.java │ ├── _482Test.java │ ├── _485Test.java │ ├── _487Test.java │ ├── _48Test.java │ ├── _490Test.java │ ├── _491Test.java │ ├── _492Test.java │ ├── _493Test.java │ ├── _494Test.java │ ├── _495Test.java │ ├── _496Test.java │ ├── _498Test.java │ ├── _49Test.java │ ├── _4Test.java │ ├── _500Test.java │ ├── _501Test.java │ ├── _502Test.java │ ├── _503Test.java │ ├── _504Test.java │ ├── _505Test.java │ ├── _506Test.java │ ├── _507Test.java │ ├── _508Test.java │ ├── _509Test.java │ ├── _50Test.java │ ├── _513Test.java │ ├── _515Test.java │ ├── _516Test.java │ ├── _518Test.java │ ├── _519Test.java │ ├── _51Test.java │ ├── _522Test.java │ ├── _523Test.java │ ├── _524Test.java │ ├── _525Test.java │ ├── _526Test.java │ ├── _527Test.java │ ├── _528Test.java │ ├── _529Test.java │ ├── _52Test.java │ ├── _530Test.java │ ├── _532Test.java │ ├── _533Test.java │ ├── _536Test.java │ ├── _537Test.java │ ├── _538Test.java │ ├── _539Test.java │ ├── _53Test.java │ ├── _540Test.java │ ├── _541Test.java │ ├── _542Test.java │ ├── _543Test.java │ ├── _544Test.java │ ├── _545Test.java │ ├── _547Test.java │ ├── _548Test.java │ ├── _549Test.java │ ├── _54Test.java │ ├── _551Test.java │ ├── _553Test.java │ ├── _554Test.java │ ├── _555Test.java │ ├── _556Test.java │ ├── _559Test.java │ ├── _55Test.java │ ├── _560Test.java │ ├── _561Test.java │ ├── _562Test.java │ ├── _563Test.java │ ├── _566Test.java │ ├── _567Test.java │ ├── _56Test.java │ ├── _572Test.java │ ├── _575Test.java │ ├── _57Test.java │ ├── _581Test.java │ ├── _582Test.java │ ├── _583Test.java │ ├── _588Test.java │ ├── _589Test.java │ ├── _58Test.java │ ├── _591Test.java │ ├── _592Test.java │ ├── _593Test.java │ ├── _594Test.java │ ├── _598Test.java │ ├── _59Test.java │ ├── _5Test.java │ ├── _600Test.java │ ├── _604Test.java │ ├── _605Test.java │ ├── _606Test.java │ ├── _609Test.java │ ├── _60Test.java │ ├── _611Test.java │ ├── _617Test.java │ ├── _61Test.java │ ├── _621Test.java │ ├── _622Test.java │ ├── _623Test.java │ ├── _628Test.java │ ├── _62Test.java │ ├── _630Test.java │ ├── _631Test.java │ ├── _635Test.java │ ├── _636Test.java │ ├── _63Test.java │ ├── _643Test.java │ ├── _645Test.java │ ├── _646Test.java │ ├── _647Test.java │ ├── _648Test.java │ ├── _649Test.java │ ├── _64Test.java │ ├── _650Test.java │ ├── _651Test.java │ ├── _652Test.java │ ├── _653Test.java │ ├── _654Test.java │ ├── _655Test.java │ ├── _656Test.java │ ├── _658Test.java │ ├── _659Test.java │ ├── _65Test.java │ ├── _661Test.java │ ├── _662Test.java │ ├── _663Test.java │ ├── _664Test.java │ ├── _665Test.java │ ├── _666Test.java │ ├── _667Test.java │ ├── _668Test.java │ ├── _669Test.java │ ├── _66Test.java │ ├── _670Test.java │ ├── _671Test.java │ ├── _672Test.java │ ├── _673Test.java │ ├── _674Test.java │ ├── _675Test.java │ ├── _676Test.java │ ├── _678Test.java │ ├── _679Test.java │ ├── _67Test.java │ ├── _680Test.java │ ├── _681Test.java │ ├── _682Test.java │ ├── _683Test.java │ ├── _684Test.java │ ├── _685Test.java │ ├── _686Test.java │ ├── _687Test.java │ ├── _688Test.java │ ├── _689Test.java │ ├── _68Test.java │ ├── _690Test.java │ ├── _692Test.java │ ├── _694Test.java │ ├── _695Test.java │ ├── _697Test.java │ ├── _698Test.java │ ├── _699Test.java │ ├── _69Test.java │ ├── _6Test.java │ ├── _700Test.java │ ├── _701Test.java │ ├── _703Test.java │ ├── _704Test.java │ ├── _706Test.java │ ├── _709Test.java │ ├── _70Test.java │ ├── _712Test.java │ ├── _713Test.java │ ├── _714Test.java │ ├── _716Test.java │ ├── _718Test.java │ ├── _719Test.java │ ├── _71Test.java │ ├── _720Test.java │ ├── _721Test.java │ ├── _722Test.java │ ├── _723Test.java │ ├── _724Test.java │ ├── _725Test.java │ ├── _726Test.java │ ├── _727Test.java │ ├── _728Test.java │ ├── _72Test.java │ ├── _733Test.java │ ├── _734Test.java │ ├── _735Test.java │ ├── _737Test.java │ ├── _738Test.java │ ├── _739Test.java │ ├── _73Test.java │ ├── _740Test.java │ ├── _742Test.java │ ├── _743Test.java │ ├── _744Test.java │ ├── _746Test.java │ ├── _747Test.java │ ├── _748Test.java │ ├── _74Test.java │ ├── _750Test.java │ ├── _752Test.java │ ├── _754Test.java │ ├── _755Test.java │ ├── _756Test.java │ ├── _757Test.java │ ├── _758Test.java │ ├── _75Test.java │ ├── _760Test.java │ ├── _762Test.java │ ├── _763Test.java │ ├── _764Test.java │ ├── _765Test.java │ ├── _766Test.java │ ├── _767Test.java │ ├── _769Test.java │ ├── _76Test.java │ ├── _771Test.java │ ├── _773Test.java │ ├── _775Test.java │ ├── _776Test.java │ ├── _777Test.java │ ├── _779Test.java │ ├── _77Test.java │ ├── _781Test.java │ ├── _783Test.java │ ├── _784Test.java │ ├── _785Test.java │ ├── _788Test.java │ ├── _789Test.java │ ├── _78Test.java │ ├── _791Test.java │ ├── _792Test.java │ ├── _796Test.java │ ├── _799Test.java │ ├── _79Test.java │ ├── _7Test.java │ ├── _800Test.java │ ├── _802Test.java │ ├── _804Test.java │ ├── _806Test.java │ ├── _807Test.java │ ├── _809Test.java │ ├── _80Test.java │ ├── _811Test.java │ ├── _812Test.java │ ├── _814Test.java │ ├── _819Test.java │ ├── _81Test.java │ ├── _821Test.java │ ├── _823Test.java │ ├── _824Test.java │ ├── _826Test.java │ ├── _82Test.java │ ├── _830Test.java │ ├── _832Test.java │ ├── _836Test.java │ ├── _838Test.java │ ├── _83Test.java │ ├── _840Test.java │ ├── _841Test.java │ ├── _844Test.java │ ├── _848Test.java │ ├── _849Test.java │ ├── _84Test.java │ ├── _851Test.java │ ├── _852Test.java │ ├── _856Test.java │ ├── _859Test.java │ ├── _85Test.java │ ├── _860Test.java │ ├── _861Test.java │ ├── _867Test.java │ ├── _868Test.java │ ├── _86Test.java │ ├── _870Test.java │ ├── _872Test.java │ ├── _875Test.java │ ├── _876Test.java │ ├── _877Test.java │ ├── _87Test.java │ ├── _880Test.java │ ├── _881Test.java │ ├── _883Test.java │ ├── _884Test.java │ ├── _885Test.java │ ├── _888Test.java │ ├── _88Test.java │ ├── _890Test.java │ ├── _892Test.java │ ├── _893Test.java │ ├── _895Test.java │ ├── _896Test.java │ ├── _897Test.java │ ├── _89Test.java │ ├── _8Test.java │ ├── _900Test.java │ ├── _901Test.java │ ├── _904Test.java │ ├── _905Test.java │ ├── _908Test.java │ ├── _90Test.java │ ├── _914Test.java │ ├── _917Test.java │ ├── _918Test.java │ ├── _919Test.java │ ├── _91Test.java │ ├── _921Test.java │ ├── _922Test.java │ ├── _923Test.java │ ├── _925Test.java │ ├── _929Test.java │ ├── _92Test.java │ ├── _931Test.java │ ├── _933Test.java │ ├── _934Test.java │ ├── _935Test.java │ ├── _936Test.java │ ├── _937Test.java │ ├── _938Test.java │ ├── _93Test.java │ ├── _941Test.java │ ├── _942Test.java │ ├── _944Test.java │ ├── _945Test.java │ ├── _946Test.java │ ├── _94Test.java │ ├── _950Test.java │ ├── _951Test.java │ ├── _953Test.java │ ├── _954Test.java │ ├── _957Test.java │ ├── _958Test.java │ ├── _95Test.java │ ├── _961Test.java │ ├── _965Test.java │ ├── _966Test.java │ ├── _96Test.java │ ├── _970Test.java │ ├── _973Test.java │ ├── _974Test.java │ ├── _976Test.java │ ├── _977Test.java │ ├── _979Test.java │ ├── _97Test.java │ ├── _980Test.java │ ├── _985Test.java │ ├── _986Test.java │ ├── _987Test.java │ ├── _988Test.java │ ├── _989Test.java │ ├── _98Test.java │ ├── _993Test.java │ ├── _994Test.java │ ├── _997Test.java │ ├── _999Test.java │ ├── _99Test.java │ └── _9Test.java │ ├── fourththousand │ ├── _3004Test.java │ ├── _3006Test.java │ ├── _3016Test.java │ ├── _3038Test.java │ ├── _3074Test.java │ ├── _3079Test.java │ ├── _3083Test.java │ ├── _3090Test.java │ ├── _3095Test.java │ ├── _3112Test.java │ ├── _3142Test.java │ ├── _3175Test.java │ ├── _3178Test.java │ ├── _3185Test.java │ ├── _3186Test.java │ ├── _3189Test.java │ ├── _3191Test.java │ ├── _3192Test.java │ ├── _3196Test.java │ ├── _3199Test.java │ ├── _3208Test.java │ ├── _3223Test.java │ ├── _3224Test.java │ ├── _3226Test.java │ ├── _3228Test.java │ ├── _3233Test.java │ ├── _3234Test.java │ ├── _3237Test.java │ ├── _3240Test.java │ ├── _3241Test.java │ ├── _3243Test.java │ ├── _3258Test.java │ ├── _3270Test.java │ ├── _3280Test.java │ ├── _3304Test.java │ ├── _3318Test.java │ ├── _3324Test.java │ ├── _3345Test.java │ ├── _3349Test.java │ ├── _3353Test.java │ ├── _3354Test.java │ ├── _3364Test.java │ ├── _3375Test.java │ ├── _3379Test.java │ ├── _3386Test.java │ ├── _3402Test.java │ ├── _3471Test.java │ ├── _3491Test.java │ └── _3502Test.java │ ├── secondthousand │ ├── _1002Test.java │ ├── _1003Test.java │ ├── _1004Test.java │ ├── _1005Test.java │ ├── _1008Test.java │ ├── _1009Test.java │ ├── _1010Test.java │ ├── _1011Test.java │ ├── _1013Test.java │ ├── _1014Test.java │ ├── _1018Test.java │ ├── _1019Test.java │ ├── _1020Test.java │ ├── _1021Test.java │ ├── _1022Test.java │ ├── _1024Test.java │ ├── _1025Test.java │ ├── _1026Test.java │ ├── _1029Test.java │ ├── _1030Test.java │ ├── _1033Test.java │ ├── _1034Test.java │ ├── _1037Test.java │ ├── _1038Test.java │ ├── _1043Test.java │ ├── _1046Test.java │ ├── _1047Test.java │ ├── _1049Test.java │ ├── _1051Test.java │ ├── _1055Test.java │ ├── _1056Test.java │ ├── _1057Test.java │ ├── _1059Test.java │ ├── _1060Test.java │ ├── _1061Test.java │ ├── _1062Test.java │ ├── _1065Test.java │ ├── _1066Test.java │ ├── _1071Test.java │ ├── _1078Test.java │ ├── _1079Test.java │ ├── _1080Test.java │ ├── _1085Test.java │ ├── _1086Test.java │ ├── _1087Test.java │ ├── _1089Test.java │ ├── _1090Test.java │ ├── _1091Test.java │ ├── _1094Test.java │ ├── _1099Test.java │ ├── _1100Test.java │ ├── _1103Test.java │ ├── _1104Test.java │ ├── _1105Test.java │ ├── _1108Test.java │ ├── _1110Test.java │ ├── _1118Test.java │ ├── _1119Test.java │ ├── _1122Test.java │ ├── _1128Test.java │ ├── _1133Test.java │ ├── _1134Test.java │ ├── _1136Test.java │ ├── _1137Test.java │ ├── _1138Test.java │ ├── _1143Test.java │ ├── _1145Test.java │ ├── _1146Test.java │ ├── _1150Test.java │ ├── _1151Test.java │ ├── _1152Test.java │ ├── _1154Test.java │ ├── _1160Test.java │ ├── _1161Test.java │ ├── _1165Test.java │ ├── _1170Test.java │ ├── _1171Test.java │ ├── _1175Test.java │ ├── _1176Test.java │ ├── _1180Test.java │ ├── _1182Test.java │ ├── _1184Test.java │ ├── _1185Test.java │ ├── _1189Test.java │ ├── _1190Test.java │ ├── _1196Test.java │ ├── _1197Test.java │ ├── _1198Test.java │ ├── _1200Test.java │ ├── _1207Test.java │ ├── _1209Test.java │ ├── _1213Test.java │ ├── _1214Test.java │ ├── _1217Test.java │ ├── _1219Test.java │ ├── _1221Test.java │ ├── _1228Test.java │ ├── _1230Test.java │ ├── _1232Test.java │ ├── _1233Test.java │ ├── _1243Test.java │ ├── _1249Test.java │ ├── _1252Test.java │ ├── _1257Test.java │ ├── _1258Test.java │ ├── _1260Test.java │ ├── _1266Test.java │ ├── _1267Test.java │ ├── _1268Test.java │ ├── _1271Test.java │ ├── _1273Test.java │ ├── _1275Test.java │ ├── _1277Test.java │ ├── _1281Test.java │ ├── _1282Test.java │ ├── _1283Test.java │ ├── _1286Test.java │ ├── _1287Test.java │ ├── _1289Test.java │ ├── _1290Test.java │ ├── _1291Test.java │ ├── _1295Test.java │ ├── _1296Test.java │ ├── _1297Test.java │ ├── _1299Test.java │ ├── _1300Test.java │ ├── _1302Test.java │ ├── _1304Test.java │ ├── _1305Test.java │ ├── _1309Test.java │ ├── _1313Test.java │ ├── _1314Test.java │ ├── _1315Test.java │ ├── _1317Test.java │ ├── _1323Test.java │ ├── _1324Test.java │ ├── _1325Test.java │ ├── _1331Test.java │ ├── _1333Test.java │ ├── _1334Test.java │ ├── _1337Test.java │ ├── _1338Test.java │ ├── _1339Test.java │ ├── _1341Test.java │ ├── _1342Test.java │ ├── _1343Test.java │ ├── _1344Test.java │ ├── _1345Test.java │ ├── _1346Test.java │ ├── _1347Test.java │ ├── _1348Test.java │ ├── _1349Test.java │ ├── _1352Test.java │ ├── _1353Test.java │ ├── _1354Test.java │ ├── _1356Test.java │ ├── _1357Test.java │ ├── _1358Test.java │ ├── _1360Test.java │ ├── _1361Test.java │ ├── _1362Test.java │ ├── _1365Test.java │ ├── _1366Test.java │ ├── _1367Test.java │ ├── _1370Test.java │ ├── _1371Test.java │ ├── _1372Test.java │ ├── _1373Test.java │ ├── _1374Test.java │ ├── _1375Test.java │ ├── _1376Test.java │ ├── _1377Test.java │ ├── _1379Test.java │ ├── _1380Test.java │ ├── _1381Test.java │ ├── _1382Test.java │ ├── _1385Test.java │ ├── _1386Test.java │ ├── _1387Test.java │ ├── _1388Test.java │ ├── _1389Test.java │ ├── _1390Test.java │ ├── _1392Test.java │ ├── _1394Test.java │ ├── _1395Test.java │ ├── _1399Test.java │ ├── _1400Test.java │ ├── _1401Test.java │ ├── _1403Test.java │ ├── _1405Test.java │ ├── _1408Test.java │ ├── _1409Test.java │ ├── _1410Test.java │ ├── _1413Test.java │ ├── _1414Test.java │ ├── _1415Test.java │ ├── _1417Test.java │ ├── _1418Test.java │ ├── _1422Test.java │ ├── _1423Test.java │ ├── _1424Test.java │ ├── _1426Test.java │ ├── _1427Test.java │ ├── _1428Test.java │ ├── _1431Test.java │ ├── _1432Test.java │ ├── _1436Test.java │ ├── _1437Test.java │ ├── _1438Test.java │ ├── _1439Test.java │ ├── _1441Test.java │ ├── _1446Test.java │ ├── _1447Test.java │ ├── _1448Test.java │ ├── _1450Test.java │ ├── _1451Test.java │ ├── _1452Test.java │ ├── _1455Test.java │ ├── _1456Test.java │ ├── _1457Test.java │ ├── _1460Test.java │ ├── _1461Test.java │ ├── _1462Test.java │ ├── _1464Test.java │ ├── _1466Test.java │ ├── _1469Test.java │ ├── _1470Test.java │ ├── _1471Test.java │ ├── _1472Test.java │ ├── _1474Test.java │ ├── _1475Test.java │ ├── _1476Test.java │ ├── _1480Test.java │ ├── _1481Test.java │ ├── _1482Test.java │ ├── _1485Test.java │ ├── _1486Test.java │ ├── _1487Test.java │ ├── _1490Test.java │ ├── _1491Test.java │ ├── _1492Test.java │ ├── _1493Test.java │ ├── _1496Test.java │ ├── _1502Test.java │ ├── _1507Test.java │ ├── _1508Test.java │ ├── _1509Test.java │ ├── _1512Test.java │ ├── _1514Test.java │ ├── _1518Test.java │ ├── _1523Test.java │ ├── _1524Test.java │ ├── _1525Test.java │ ├── _1526Test.java │ ├── _1528Test.java │ ├── _1530Test.java │ ├── _1534Test.java │ ├── _1535Test.java │ ├── _1539Test.java │ ├── _1541Test.java │ ├── _1544Test.java │ ├── _1545Test.java │ ├── _1550Test.java │ ├── _1551Test.java │ ├── _1556Test.java │ ├── _1557Test.java │ ├── _1558Test.java │ ├── _1560Test.java │ ├── _1561Test.java │ ├── _1566Test.java │ ├── _1567Test.java │ ├── _1572Test.java │ ├── _1574Test.java │ ├── _1576Test.java │ ├── _1577Test.java │ ├── _1582Test.java │ ├── _1583Test.java │ ├── _1588Test.java │ ├── _1592Test.java │ ├── _1600Test.java │ ├── _1604Test.java │ ├── _1605Test.java │ ├── _1625Test.java │ ├── _1626Test.java │ ├── _1628Test.java │ ├── _1636Test.java │ ├── _1640Test.java │ ├── _1641Test.java │ ├── _1642Test.java │ ├── _1644Test.java │ ├── _1646Test.java │ ├── _1652Test.java │ ├── _1653Test.java │ ├── _1656Test.java │ ├── _1657Test.java │ ├── _1658Test.java │ ├── _1663Test.java │ ├── _1669Test.java │ ├── _1670Test.java │ ├── _1673Test.java │ ├── _1675Test.java │ ├── _1676Test.java │ ├── _1679Test.java │ ├── _1685Test.java │ ├── _1686Test.java │ ├── _1688Test.java │ ├── _1690Test.java │ ├── _1694Test.java │ ├── _1695Test.java │ ├── _1700Test.java │ ├── _1701Test.java │ ├── _1705Test.java │ ├── _1708Test.java │ ├── _1711Test.java │ ├── _1716Test.java │ ├── _1717Test.java │ ├── _1718Test.java │ ├── _1721Test.java │ ├── _1726Test.java │ ├── _1727Test.java │ ├── _1730Test.java │ ├── _1733Test.java │ ├── _1745Test.java │ ├── _1746Test.java │ ├── _1752Test.java │ ├── _1753Test.java │ ├── _1754Test.java │ ├── _1758Test.java │ ├── _1759Test.java │ ├── _1762Test.java │ ├── _1768Test.java │ ├── _1772Test.java │ ├── _1774Test.java │ ├── _1775Test.java │ ├── _1781Test.java │ ├── _1790Test.java │ ├── _1792Test.java │ ├── _1804Test.java │ ├── _1813Test.java │ ├── _1814Test.java │ ├── _1823Test.java │ ├── _1826Test.java │ ├── _1836Test.java │ ├── _1844Test.java │ ├── _1861Test.java │ ├── _1862Test.java │ ├── _1868Test.java │ ├── _1869Test.java │ ├── _1886Test.java │ ├── _1891Test.java │ ├── _1893Test.java │ ├── _1894Test.java │ ├── _1903Test.java │ ├── _1904Test.java │ ├── _1933Test.java │ ├── _1936Test.java │ ├── _1945Test.java │ ├── _1966Test.java │ ├── _1968Test.java │ ├── _1971Test.java │ ├── _1973Test.java │ ├── _1974Test.java │ ├── _1981Test.java │ ├── _1984Test.java │ ├── _1985Test.java │ ├── _1991Test.java │ ├── _1992Test.java │ └── _1993Test.java │ └── thirdthousand │ ├── _2001Test.java │ ├── _2007Test.java │ ├── _2012Test.java │ ├── _2017Test.java │ ├── _2018Test.java │ ├── _2024Test.java │ ├── _2028Test.java │ ├── _2038Test.java │ ├── _2039Test.java │ ├── _2049Test.java │ ├── _2050Test.java │ ├── _2054Test.java │ ├── _2063Test.java │ ├── _2070Test.java │ ├── _2075Test.java │ ├── _2076Test.java │ ├── _2080Test.java │ ├── _2096Test.java │ ├── _2103Test.java │ ├── _2115Test.java │ ├── _2116Test.java │ ├── _2126Test.java │ ├── _2134Test.java │ ├── _2135Test.java │ ├── _2144Test.java │ ├── _2156Test.java │ ├── _2190Test.java │ ├── _2191Test.java │ ├── _2192Test.java │ ├── _2196Test.java │ ├── _2220Test.java │ ├── _2224Test.java │ ├── _2231Test.java │ ├── _2265Test.java │ ├── _2273Test.java │ ├── _2284Test.java │ ├── _2293Test.java │ ├── _2300Test.java │ ├── _2309Test.java │ ├── _2315Test.java │ ├── _2316Test.java │ ├── _2325Test.java │ ├── _2335Test.java │ ├── _2357Test.java │ ├── _2373Test.java │ ├── _2385Test.java │ ├── _2389Test.java │ ├── _2392Test.java │ ├── _2409Test.java │ ├── _2423Test.java │ ├── _2433Test.java │ ├── _2437Test.java │ ├── _2441Test.java │ ├── _2446Test.java │ ├── _2451Test.java │ ├── _2460Test.java │ ├── _2473Test.java │ ├── _2485Test.java │ ├── _2487Test.java │ ├── _2492Test.java │ ├── _2500Test.java │ ├── _2501Test.java │ ├── _2511Test.java │ ├── _2515Test.java │ ├── _2525Test.java │ ├── _2544Test.java │ ├── _2566Test.java │ ├── _2574Test.java │ ├── _2578Test.java │ ├── _2591Test.java │ ├── _2600Test.java │ ├── _2609Test.java │ ├── _2641Test.java │ ├── _2644Test.java │ ├── _2670Test.java │ ├── _2673Test.java │ ├── _2682Test.java │ ├── _2689Test.java │ ├── _2696Test.java │ ├── _2710Test.java │ ├── _2716Test.java │ ├── _2717Test.java │ ├── _2729Test.java │ ├── _2739Test.java │ ├── _2744Test.java │ ├── _2748Test.java │ ├── _2751Test.java │ ├── _2760Test.java │ ├── _2765Test.java │ ├── _2788Test.java │ ├── _2839Test.java │ ├── _2843Test.java │ ├── _2848Test.java │ ├── _2855Test.java │ ├── _2900Test.java │ ├── _2913Test.java │ ├── _2917Test.java │ ├── _2928Test.java │ ├── _2937Test.java │ ├── _2946Test.java │ ├── _2970Test.java │ ├── _2976Test.java │ └── _2996Test.java └── resources └── fishercoder.properties /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | name: Java CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | permissions: read-all 10 | jobs: 11 | build-linux: 12 | name: build-linux 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | with: 19 | fetch-depth: 0 20 | - name: Set up JDK 17 21 | uses: actions/setup-java@v4 22 | with: 23 | distribution: 'temurin' 24 | java-version: '17' 25 | cache: 'gradle' 26 | - name: Build with Gradle 27 | run: chmod +x gradlew && ./gradlew build 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle/ 2 | .DS_Store 3 | build/ 4 | out/ 5 | .idea/ 6 | *.iml 7 | *.vscode/ 8 | src/main/java/com/fishercoder/solutions/_99999RandomQuestions.java 9 | src/main/java/com/fishercoder/solutions/_Contest.java 10 | .project 11 | bin -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - openjdk10 5 | 6 | before_script: 7 | - chmod a+x gradlew 8 | 9 | node_js: "v13.7.0" 10 | install: "npm install && npm install standard --global" 11 | 12 | script: ./gradlew clean build && standard javascript/* 13 | 14 | notifications: 15 | email: 16 | recipients: 17 | - fishercoder@gmail.com 18 | on_failure: always 19 | 20 | branches: 21 | only: 22 | - master -------------------------------------------------------------------------------- /cpp/_1402.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | int maxSatisfaction(vector& sat) { 4 | // we'll greedily only consider a suffix of the sorted array 5 | sort(sat.begin(), sat.end()); 6 | int cmax = 0; 7 | int sum = 0; 8 | int csum = 0; 9 | int i = sat.size(); // iterate from n - 1 to 0 10 | while(i--) { 11 | // calulate current satisfaction 12 | csum += sat[i]; 13 | sum += csum; 14 | // compare with cmax 15 | cmax = max(cmax, sum); 16 | } 17 | return cmax; 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /cpp/_1431.cpp: -------------------------------------------------------------------------------- 1 | // Kids With the Greatest Number of Candies 2 | 3 | class Solution { 4 | public: 5 | vector kidsWithCandies(vector& candies, int extraCandies) { 6 | 7 | vector v; 8 | int mx=0; 9 | 10 | for(int i=0;i shuffle(vector& nums, int n) { 6 | 7 | vector v; 8 | 9 | for(int i=0;i runningSum(vector& nums) { 6 | 7 | for(int i=1;i& coins, int amount){ 7 | 8 | int MAX = amount + 1; 9 | vector cache(amount + 1, MAX); 10 | 11 | cache[0] = 0; 12 | for(auto coin : coins){ 13 | for(int i = coin; i <= amount; i++) 14 | cache[i] = std::min(cache[i], cache[i - coin] + 1); 15 | } 16 | 17 | return cache[amount] == MAX ? -1 : cache[amount]; 18 | } 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /cpp/_4.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | double findMedianSortedArrays(vector& nums1, vector& nums2) { 4 | //for adding second vector to last of first vector 5 | nums1.insert(nums1.end(),nums2.begin(),nums2.end()); 6 | sort(nums1.begin(),nums1.end()); 7 | 8 | int size = nums1.size(); 9 | float sum = nums1[size/2]; 10 | 11 | if(size%2==0){ 12 | sum += nums1[(size/2)-1]; 13 | sum/=2; 14 | } 15 | 16 | return (float)(sum); 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /cpp/_41.cpp: -------------------------------------------------------------------------------- 1 | //Problem Link : https://leetcode.com/problems/first-missing-positive/ 2 | 3 | class Solution { 4 | public: 5 | int firstMissingPositive(vector& nums) { 6 | for(int i=1;i<=nums.size()+1;i++){ 7 | int d=count(nums.begin(),nums.end(),i); 8 | if(d==0) return i; 9 | } 10 | return 0; 11 | } 12 | }; -------------------------------------------------------------------------------- /cpp/_461.cpp: -------------------------------------------------------------------------------- 1 | // Hamming Distance 2 | 3 | class Solution { 4 | public: 5 | int hammingDistance(int x, int y) { 6 | int c = x^y; 7 | return __builtin_popcount(c); 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /database/_1050.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select actor_id, director_id from ActorDirector 3 | group by actor_id, director_id 4 | having count(*) >= 3; -------------------------------------------------------------------------------- /database/_1068.sql: -------------------------------------------------------------------------------- 1 | select p.product_name, s.year, s.price 2 | from Product p 3 | join Sales s 4 | on s.product_id = p.product_id -------------------------------------------------------------------------------- /database/_1069.sql: -------------------------------------------------------------------------------- 1 | SELECT product_id, SUM(quantity) AS total_quantity FROM Sales GROUP BY product_id; -------------------------------------------------------------------------------- /database/_1075.sql: -------------------------------------------------------------------------------- 1 | select project_id, round(avg(experience_years), 2) as average_years 2 | from Project 3 | join Employee 4 | using (employee_id) 5 | group by project_id 6 | order by project_id -------------------------------------------------------------------------------- /database/_1076.sql: -------------------------------------------------------------------------------- 1 | select project_id from Project 2 | group by project_id 3 | having count(employee_id) = 4 | ( 5 | select count(employee_id) 6 | from Project 7 | group by project_id 8 | order by count(employee_id) 9 | desc 10 | limit 1 11 | ) -------------------------------------------------------------------------------- /database/_1082.sql: -------------------------------------------------------------------------------- 1 | select seller_id from Sales as seller_id 2 | group by seller_id 3 | having sum(price) = ( 4 | select sum(price) as total_price from Sales 5 | group by seller_id 6 | order by total_price desc 7 | limit 1 8 | ) -------------------------------------------------------------------------------- /database/_1083.sql: -------------------------------------------------------------------------------- 1 | select distinct buyer_id from Sales s 2 | join Product p 3 | on p.product_id = s.product_id 4 | where p.product_name = 'S8' 5 | and buyer_id not in 6 | ( 7 | select buyer_id from Sales s 8 | join Product p on p.product_id = s.product_id 9 | where p.product_name = 'iPhone' 10 | ) -------------------------------------------------------------------------------- /database/_1084.sql: -------------------------------------------------------------------------------- 1 | select s.product_id, p.product_name from Sales s 2 | join Product p using(product_id) 3 | group by product_id 4 | having min(s.sale_date) >= '2019-01-01' and max(s.sale_date) <= '2019-03-31 '; -------------------------------------------------------------------------------- /database/_1113.sql: -------------------------------------------------------------------------------- 1 | select extra as report_reason, count(distinct(post_id)) as report_count from Actions where action_date = '2019-07-04' and action = 'report' group by extra; -------------------------------------------------------------------------------- /database/_1141.sql: -------------------------------------------------------------------------------- 1 | select activity_date as day, count(distinct(user_id)) as active_users from Activity 2 | where activity_date between "2019-06-28" and "2019-07-27" 3 | group by activity_date; -------------------------------------------------------------------------------- /database/_1142.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select ifnull(round(count(distinct session_id)/count(distinct user_id), 2), 0.00) 3 | as average_sessions_per_user 4 | from Activity 5 | where activity_date between '2019-06-28' and '2019-07-27'; -------------------------------------------------------------------------------- /database/_1148.sql: -------------------------------------------------------------------------------- 1 | select distinct(author_id) as id from Views where author_id = viewer_id order by id asc; -------------------------------------------------------------------------------- /database/_1173.sql: -------------------------------------------------------------------------------- 1 | select round( 2 | ( 3 | 100 * (select count(*) from Delivery d where d.order_date = d.customer_pref_delivery_date)/ 4 | (select count(*) from Delivery) 5 | ), 6 | 2) as immediate_percentage; -------------------------------------------------------------------------------- /database/_1211.sql: -------------------------------------------------------------------------------- 1 | select query_name, round(avg(rating/position), 2) as quality, round(avg(rating < 3) * 100, 2) as poor_query_percentage from Queries group by query_name; -------------------------------------------------------------------------------- /database/_1241.sql: -------------------------------------------------------------------------------- 1 | select s.sub_id as post_id, 2 | (select count(distinct(s1.sub_id)) from Submissions s1 where s1.parent_id = s.sub_id) as number_of_comments 3 | from Submissions s 4 | where s.parent_id is null 5 | group by s.sub_id; -------------------------------------------------------------------------------- /database/_1251.sql: -------------------------------------------------------------------------------- 1 | select a.product_id, round( 2 | sum(a.price * b.units)/sum(b.units), 3 | 2) as average_price 4 | from Prices as a 5 | join UnitsSold as b 6 | on a.product_id = b.product_id and (b.purchase_date between a.start_date and a.end_date) 7 | group by a.product_id; -------------------------------------------------------------------------------- /database/_1270.sql: -------------------------------------------------------------------------------- 1 | select e3.employee_id from Employees e1, Employees e2, Employees e3 2 | where e1.manager_id = 1 and e2.manager_id = e1.employee_id and e3.manager_id = e2.employee_id and e3.employee_id != 1 -------------------------------------------------------------------------------- /database/_1280.sql: -------------------------------------------------------------------------------- 1 | select a.student_id, a.student_name, b.subject_name, count(c.subject_name) as attended_exams 2 | from Students as a 3 | join Subjects as b 4 | left join Examinations as c 5 | on a.student_id = c.student_id and b.subject_name = c.subject_name 6 | group by a.student_id, b.subject_name; -------------------------------------------------------------------------------- /database/_1285.sql: -------------------------------------------------------------------------------- 1 | select l1.log_id as start_id, min(l2.log_id) as end_id 2 | from 3 | ( 4 | select log_id from Logs where log_id - 1 not in (select log_id from Logs) 5 | ) l1, 6 | ( 7 | select log_id from Logs where log_id + 1 not in (select log_id from Logs) 8 | ) l2 9 | where l1.log_id <= l2.log_id 10 | group by l1.log_id; 11 | -------------------------------------------------------------------------------- /database/_1294.sql: -------------------------------------------------------------------------------- 1 | select c.country_name as country_name, 2 | case 3 | when avg(weather_state) <= 15 then "Cold" 4 | when avg(weather_state) >= 25 then "Hot" 5 | else "Warm" 6 | end 7 | as weather_type 8 | from Countries c 9 | join Weather w 10 | on c.country_id = w.country_id 11 | and w.day between "2019-11-01" and "2019-11-30" 12 | group by c.country_id 13 | -------------------------------------------------------------------------------- /database/_1303.sql: -------------------------------------------------------------------------------- 1 | select employee_id, team_size from Employee e 2 | left join 3 | ( 4 | select team_id, count(distinct(employee_id)) as team_size from Employee group by team_id 5 | ) as t 6 | on e.team_id = t.team_id; -------------------------------------------------------------------------------- /database/_1308.sql: -------------------------------------------------------------------------------- 1 | select s1.gender, s1.day, sum(s2.score_points) as total from Scores s1, Scores s2 2 | where s1.gender = s2.gender and s1.day >= s2.day 3 | group by s1.gender, s1.day 4 | order by s1.gender, s1.day -------------------------------------------------------------------------------- /database/_1322.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select ad_id, 3 | ifnull( 4 | round( 5 | avg( 6 | case 7 | when action = "Clicked" then 1 8 | when action = "Viewed" then 0 9 | else null 10 | end 11 | ) * 100, 12 | 2), 13 | 0) 14 | as ctr 15 | from Ads 16 | group by ad_id 17 | order by ctr desc, ad_id asc; -------------------------------------------------------------------------------- /database/_1327.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | --credit: https://leetcode.com/problems/list-the-products-ordered-in-a-period/discuss/491314/MYSQL 3 | 4 | select a.product_name, sum(unit) as unit 5 | from Products a 6 | left join Orders b 7 | on a.product_id = b.product_id 8 | where b.order_date between '2020-02-01' and '2020-02-29' 9 | group by a.product_id 10 | having sum(unit) >= 100 -------------------------------------------------------------------------------- /database/_1350.sql: -------------------------------------------------------------------------------- 1 | select id, name from Students where department_id not in (select id from Departments); -------------------------------------------------------------------------------- /database/_1355.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select activity from Friends group by activity 3 | having count(id) not in 4 | ( 5 | select max(cnt) as cnt from 6 | (select count(*) as cnt from Friends group by activity) as t1 7 | union 8 | select min(cnt) as cnt from 9 | (select count(*) as cnt from Friends group by activity) as t2 10 | ) -------------------------------------------------------------------------------- /database/_1364.sql: -------------------------------------------------------------------------------- 1 | --credit: https://leetcode.com/problems/number-of-trusted-contacts-of-a-customer/discuss/522435/mysql-simple-solution 2 | 3 | select i.invoice_id, 4 | c.customer_name, 5 | i.price, 6 | count(cont.contact_name) contacts_cnt, 7 | sum( 8 | if(cont.contact_name in (select distinct customer_name from customers), 1, 0) 9 | ) as trusted_contacts_cnt 10 | from invoices i 11 | join customers c on c.customer_id = i.user_id 12 | left join Contacts cont on cont.user_id = c.customer_id 13 | group by i.invoice_id 14 | order by i.invoice_id; 15 | -------------------------------------------------------------------------------- /database/_1369.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | --credit: https://leetcode.com/problems/get-the-second-most-recent-activity/discuss/530992/MySQL-solution-184ms-no-subquery 3 | 4 | select * from UserActivity 5 | group by username 6 | having count(*) = 1 7 | 8 | union all 9 | 10 | select u1.* 11 | from UserActivity as u1 12 | left join UserActivity as u2 13 | on u1.username = u2.username and u1.endDate < u2.endDate 14 | group by u1.username, u1.endDate 15 | having count(u2.endDate) = 1 -------------------------------------------------------------------------------- /database/_1371.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select b.employee_id, b.name, count(*) as reports_count, round(avg(a.age)) as average_age 3 | from Employees a join Employees b on a.reports_to = b.employee_id 4 | group by b.employee_id 5 | order by b.employee_id -------------------------------------------------------------------------------- /database/_1378.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | 3 | select uni.unique_id, emp.name from Employees emp 4 | left join 5 | EmployeeUNI uni 6 | on emp.id = uni.id -------------------------------------------------------------------------------- /database/_1393.sql: -------------------------------------------------------------------------------- 1 | select stock_name, sum( 2 | case 3 | when operation = 'Buy' then -price 4 | else price 5 | end 6 | ) as capital_gain_loss from Stocks group by stock_name; -------------------------------------------------------------------------------- /database/_1407.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | 3 | --credit: https://leetcode.com/problems/top-travellers/discuss/572803/MySQL-Simple-Solution 4 | select name, sum(ifnull(distance, 0)) as travelled_distance 5 | from rides r 6 | right join users u 7 | on r.user_id = u.id 8 | group by name 9 | order by 2 desc,1 asc; -------------------------------------------------------------------------------- /database/_1421.sql: -------------------------------------------------------------------------------- 1 | -- # Write your MySQL query statement below 2 | select q.id, q.year, ifnull(n.npv, 0) as npv from Queries as q left join NPV as n on q.id = n.id and q.year = n.year -------------------------------------------------------------------------------- /database/_1435.sql: -------------------------------------------------------------------------------- 1 | -- # Write your MySQL query statement below 2 | with groupedBy as ( 3 | select "[0-5>" as bin, 0 as minDuration, 60*5 as maxDuration 4 | union all 5 | select "[5-10>" as bin, 60*5 as minDuration, 60*10 as maxDuration 6 | union all 7 | select "[10-15>" as bin, 60*10 as minDuration, 60*15 as maxDuration 8 | union all 9 | select "15 or more" as bin, 60*15 as minDuration, 2147483647 as maxDuration 10 | ) 11 | 12 | select bin, count(session_id) as total from groupedBy 13 | left join Sessions on duration >= minDuration and duration < maxDuration 14 | group by bin; -------------------------------------------------------------------------------- /database/_1445.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select sale_date as SALE_DATE, (o.sold_num - a.sold_num) as DIFF from Sales a join Sales o using(sale_date) group by sale_date order by sale_date -------------------------------------------------------------------------------- /database/_1484.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select sell_date, 3 | count(distinct(product)) as num_sold, 4 | group_concat(distinct product order by product asc separator ',') as products 5 | from Activities 6 | group by sell_date 7 | order by sell_date asc; -------------------------------------------------------------------------------- /database/_1495.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select title from Content where Kids_content = 'Y' and content_id in ( 3 | select content_id from TVProgram where program_date between '2020-06-01 00:00' and '2020-06-30 23:59' 4 | ) and content_type = 'Movies' -------------------------------------------------------------------------------- /database/_1511.sql: -------------------------------------------------------------------------------- 1 | select customer_id, name from Customers 2 | join Orders using(customer_id) 3 | join Product using(product_id) 4 | group by customer_id 5 | having 6 | sum(if(left(order_date, 7) = '2020-06', quantity, 0) * price) >= 100 7 | and 8 | sum(if(left(order_date, 7) = '2020-07', quantity, 0) * price) >= 100; -------------------------------------------------------------------------------- /database/_1517.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select * from Users where regexp_like(mail, '^[A-Za-z]+[A-Za-z0-9\_\.\-]*@leetcode.com') -------------------------------------------------------------------------------- /database/_1527.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select * from Patients where conditions like "DIAB1%" or conditions like "% DIAB1%"; -------------------------------------------------------------------------------- /database/_1543.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select lower(trim(product_name)) product_name, date_format(sale_date, "%Y-%m") sale_date, count(sale_id) total 3 | from sales 4 | group by 1, 2 5 | order by 1, 2 -------------------------------------------------------------------------------- /database/_1565.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select LEFT(order_date, 7) as month, count(order_id) as order_count, count(distinct(customer_id)) as customer_count from Orders where invoice > 20 group by month; -------------------------------------------------------------------------------- /database/_1571.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select name as warehouse_name, sum(units * Width * Length * Height) as volume from Warehouse w left join Products p on w.product_id = p.product_id group by name; -------------------------------------------------------------------------------- /database/_1581.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select customer_id as customer_id, count(*) as count_no_trans from Visits where visit_id not in (select distinct visit_id from Transactions) group by customer_id; -------------------------------------------------------------------------------- /database/_1587.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select u.name, sum(t.amount) as balance from Users u join Transactions t on u.account = t.account group by u.account having balance > 10000; -------------------------------------------------------------------------------- /database/_1596.sql: -------------------------------------------------------------------------------- 1 | --credit: https://leetcode.com/problems/the-most-frequently-ordered-products-for-each-customer/discuss/861257/simple-and-easy-solution-using-window-function 2 | 3 | select customer_id, product_id, product_name from 4 | ( 5 | select o.customer_id, o.product_id, p.product_name, 6 | rank() over (partition by customer_id order by count(o.product_id) desc) as ranking 7 | from Orders o 8 | join Products p 9 | on o.product_id = p.product_id 10 | group by customer_id, product_id 11 | ) tmp 12 | where ranking = 1 13 | order by customer_id, product_id -------------------------------------------------------------------------------- /database/_1607.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select seller_name from Seller as SELLER_NAME where seller_id not in ( 3 | select distinct(seller_id) from Orders where sale_date between '2020-01-01' and '2020-12-31' 4 | ) order by seller_name; -------------------------------------------------------------------------------- /database/_1623.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select a.student_name as member_A, 3 | b.student_name as member_B, 4 | c.student_name as member_C 5 | from SchoolA a cross join SchoolB b cross join SchoolC c where a.student_name != b.student_name and 6 | a.student_id != b.student_id and 7 | b.student_name != c.student_name and 8 | b.student_id != c.student_id and 9 | a.student_name != c.student_name and 10 | a.student_id != c.student_id; -------------------------------------------------------------------------------- /database/_1633.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select contest_id, round((count(distinct(user_id)) * 100 / (select count(*) from Users)), 2) as percentage from Register group by contest_id order by percentage desc, contest_id; -------------------------------------------------------------------------------- /database/_1661.sql: -------------------------------------------------------------------------------- 1 | select s.machine_id, round(avg(e.timestamp - s.timestamp), 3) as processing_time 2 | from Activity s join Activity e 3 | on s.machine_id = e.machine_id and s.process_id = e.process_id and s.activity_type = 'start' and e.activity_type = 'end' group by s.machine_id; -------------------------------------------------------------------------------- /database/_1667.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select user_id, concat(UCASE(LEFT(name, 1)), LCASE(SUBSTRING(name, 2))) as name from Users order by user_id; -------------------------------------------------------------------------------- /database/_1677.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select name, sum(rest) as rest, sum(paid) as paid, sum(canceled) as canceled, sum(refunded) as refunded from Product join Invoice using (product_id) group by name order by name; -------------------------------------------------------------------------------- /database/_1683.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select tweet_id from Tweets where length(content) > 15; -------------------------------------------------------------------------------- /database/_1693.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select date_id, make_name, count(distinct(lead_id)) as unique_leads, 3 | count(distinct(partner_id)) as unique_partners from DailySales group by date_id, make_name; -------------------------------------------------------------------------------- /database/_1709.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | with diff_table as ( 3 | select user_id, datediff(lead(visit_date, 1, '2021-1-1') over (partition by user_id order by visit_date), visit_date) as diff from UserVisits 4 | ) 5 | 6 | select user_id, max(diff) as biggest_window from diff_table group by user_id order by user_id 7 | -------------------------------------------------------------------------------- /database/_1729.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select user_id, count(follower_id) as followers_count from followers group by user_id order by user_id; -------------------------------------------------------------------------------- /database/_1741.sql: -------------------------------------------------------------------------------- 1 | -- # Write your MySQL query statement below 2 | select event_day as day, emp_id, sum(out_time - in_time) as total_time 3 | from Employees 4 | group by day, emp_id -------------------------------------------------------------------------------- /database/_175.sql: -------------------------------------------------------------------------------- 1 | # Write your MySQL query statement below 2 | select p.firstName, p.lastName, a.city, a.state 3 | from Person as p left join Address as a on p.personId = a.personId -------------------------------------------------------------------------------- /database/_1757.sql: -------------------------------------------------------------------------------- 1 | --# Write your MySQL query statement below 2 | select product_id from Products where low_fats = 'Y' and recyclable = 'Y'; -------------------------------------------------------------------------------- /database/_176.sql: -------------------------------------------------------------------------------- 1 | select max(Salary) as SecondHighestSalary from Employee where Salary < (select max(Salary) from Employee) -------------------------------------------------------------------------------- /database/_177.sql: -------------------------------------------------------------------------------- 1 | CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT 2 | BEGIN 3 | declare m int; 4 | set m=N-1; 5 | RETURN ( 6 | # Write your MySQL query statement below. 7 | select distinct Salary from Employee order by Salary desc limit m, 1 8 | ); 9 | END 10 | -------------------------------------------------------------------------------- /database/_1777.sql: -------------------------------------------------------------------------------- 1 | -- # Write your MySQL query statement below 2 | select 3 | product_id, 4 | max(case when store = 'store1' then price end) as store1, 5 | max(case when store = 'store2' then price end) as store2, 6 | max(case when store = 'store3' then price end) as store3 7 | from 8 | Products 9 | group by 10 | product_id -------------------------------------------------------------------------------- /database/_178.sql: -------------------------------------------------------------------------------- 1 | select Score, 2 | (select count(distinct Score) from Scores where Score >= s.Score) Rank 3 | from Scores s 4 | order by Score desc -------------------------------------------------------------------------------- /database/_1789.sql: -------------------------------------------------------------------------------- 1 | -- # Write your MySQL query statement below 2 | select employee_id, department_id 3 | from (select *, count(employee_id) over(partition by employee_id) as EmployeeCount from Employee) EP 4 | where EmployeeCount = 1 5 | or primary_flag = 'Y'; -------------------------------------------------------------------------------- /database/_1795.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | select product_id, 'store1' as store, store1 as price 3 | from Products 4 | where store1 is not null 5 | union 6 | select product_id, 'store2' as store, store2 as price 7 | from Products 8 | where store2 is not null 9 | union 10 | select product_id, 'store3' as store, store3 as price 11 | from Products 12 | where store3 is not null -------------------------------------------------------------------------------- /database/_180.sql: -------------------------------------------------------------------------------- 1 | select distinct l1.Num as ConsecutiveNums from Logs l1, Logs l2, Logs l3 2 | where l1.Id = l2.Id-1 and l2.Id = l3.Id-1 3 | and l1.Num = l2.Num and l2.Num = l3.Num 4 | -------------------------------------------------------------------------------- /database/_181.sql: -------------------------------------------------------------------------------- 1 | select e.Name as Employee from Employee e left join Employee b on e.ManagerId = b.Id where e.Salary > b.Salary; -------------------------------------------------------------------------------- /database/_182.sql: -------------------------------------------------------------------------------- 1 | select Email from Person group by Email having count(*) > 1; -------------------------------------------------------------------------------- /database/_1821.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | select customer_id from Customers where revenue > 0 and year = 2021; -------------------------------------------------------------------------------- /database/_183.sql: -------------------------------------------------------------------------------- 1 | select Name as Customers from Customers left join Orders on Customers.Id = Orders.CustomerId where Orders.CustomerId is Null; -------------------------------------------------------------------------------- /database/_184.sql: -------------------------------------------------------------------------------- 1 | select D.Name as Department, E.Name as Employee, E.Salary from Employee E, Department D 2 | where E.DepartmentId = D.Id 3 | and (DepartmentId, Salary) in 4 | (select DepartmentId, max(Salary) as max from Employee group by DepartmentId) 5 | -------------------------------------------------------------------------------- /database/_185.sql: -------------------------------------------------------------------------------- 1 | select D.Name as Department, E.Name as Employee, E.Salary as Salary 2 | from Department D, Employee E 3 | where (select(count(distinct(salary))) from Employee 4 | where DepartmentId = E.DepartmentId and Salary > E.Salary) < 3 5 | and E.DepartmentId = D.Id 6 | order by E.DepartmentId, E.Salary desc; -------------------------------------------------------------------------------- /database/_1853.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | -- 1. use to_char function 3 | -- 2. use FM to strip padding space, FM is a data type formatting function in PostgreSQL that removes leading zeros and trailing spaces that would otherwise be added to make a pattern's output fixed-width 4 | -- 3. Day gives you the day in the week 5 | -- 4. DD gives you the day in the month 6 | -- 5. YYYY gives you the year 7 | select to_char(day, 'FMDay, FMMonth FMDD, YYYY') as day from Days; -------------------------------------------------------------------------------- /database/_1873.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | with employee_bonus as ( 3 | select employee_id, salary as bonus from Employees where name not like 'M%' and employee_id % 2 = 1 4 | ), 5 | non_employee_bonus as ( 6 | select employee_id, 0 as bonus from Employees where employee_id not in ( 7 | select employee_id from employee_bonus 8 | )) 9 | 10 | select * from employee_bonus 11 | union 12 | select * from non_employee_bonus 13 | order by employee_id -------------------------------------------------------------------------------- /database/_196.sql: -------------------------------------------------------------------------------- 1 | delete p1 from Person p1, Person p2 where p1.Email = p2.Email and p1.Id > p2.Id -------------------------------------------------------------------------------- /database/_197.sql: -------------------------------------------------------------------------------- 1 | select w1.Id from Weather w1, Weather w2 where w1.Temperature > w2.Temperature and to_days(w1.Date) - to_days(w2.date) = 1; -------------------------------------------------------------------------------- /database/_1978.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | select employee_id 3 | from Employees 4 | where manager_id not in 5 | (select employee_id from Employees) 6 | and salary < 30000 7 | order by 1 asc -------------------------------------------------------------------------------- /database/_2026.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | select problem_id 3 | from Problems 4 | where (likes / ((likes + dislikes) * 1.0)) < 0.6 5 | order by 1; -------------------------------------------------------------------------------- /database/_2072.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | 3 | 4 | with excellent_std_cnts as (select (select count(student_id) from NewYork where score >= 90) as ny, 5 | (select count(student_id) from California where score >= 90) as ca) 6 | 7 | select (case 8 | when E.ny > E.ca then 'New York University' 9 | when E.ny < E.ca then 'California University' 10 | else 'No Winner' 11 | end 12 | ) as winner 13 | from excellent_std_cnts as E -------------------------------------------------------------------------------- /database/_2082.sql: -------------------------------------------------------------------------------- 1 | -- #Write your MySQL query statement below 2 | select count(distinct customer_id) as rich_count 3 | from Store 4 | where amount > 500; -------------------------------------------------------------------------------- /database/_2205.sql: -------------------------------------------------------------------------------- 1 | CREATE FUNCTION getUserIDs(startDate DATE, endDate DATE, minAmount INT) RETURNS INT 2 | BEGIN 3 | RETURN ( 4 | -- # Write your MySQL query statement below. 5 | select count(distinct(user_id)) from Purchases where 6 | time_stamp between timestamp(startDate) and timestamp(endDate) and amount >= minAmount 7 | ); 8 | END -------------------------------------------------------------------------------- /database/_262.sql: -------------------------------------------------------------------------------- 1 | select t.Request_at as Day, 2 | round(sum(case when t.Status like 'cancelled_%' then 1 else 0 end)/count(*), 2) as 'Cancellation Rate' 3 | from Trips t 4 | inner join Users u 5 | on t.Client_Id = u.Users_Id and u.Banned = 'No' 6 | where t.Request_at between '2013-10-01' and '2013-10-03' group by t.Request_at -------------------------------------------------------------------------------- /database/_2990.sql: -------------------------------------------------------------------------------- 1 | -- # Write your MySQL query statement below 2 | select user_id 3 | from Loans 4 | group by user_id 5 | having sum(loan_type = "Refinance") > 0 6 | and sum(loan_type = "Mortgage") > 0 7 | order by 1 asc; -------------------------------------------------------------------------------- /database/_3051.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | select candidate_id from Candidates 3 | where skill in ('Python', 'Tableau', 'PostgreSQL') group by 1 4 | having count(candidate_id) = 3 order by 1 -------------------------------------------------------------------------------- /database/_3059.sql: -------------------------------------------------------------------------------- 1 | -- Write your MySQL query statement below 2 | select substring(email, position('@' in email) + 1) as email_domain, 3 | count(*) as count 4 | from emails 5 | where email like '%@%.com' 6 | group by 1 7 | order by 1; -------------------------------------------------------------------------------- /database/_3150.sql: -------------------------------------------------------------------------------- 1 | -- Write your PostgreSQL query statement below 2 | select tweet_id 3 | from tweets 4 | where length(content) > 140 5 | or regexp_count(content, '@\w') > 3 6 | or regexp_count(content, '#\w') > 3 7 | order by 1 -------------------------------------------------------------------------------- /database/_3172.sql: -------------------------------------------------------------------------------- 1 | -- Write your MySQL query statement below 2 | -- my completely original solution 3 | select user_id 4 | from emails as e 5 | join texts as t on e.email_id = t.email_id 6 | where date_add(date(e.signup_date), Interval 1 Day) = date (t.action_date) and signup_action = 'Verified' 7 | order by user_id 8 | -------------------------------------------------------------------------------- /database/_3198.sql: -------------------------------------------------------------------------------- 1 | -- # Write your MySQL query statement below 2 | select state, 3 | group_concat(city order by city SEPARATOR ', ') as cities 4 | from cities 5 | group by state 6 | order by state -------------------------------------------------------------------------------- /database/_511.sql: -------------------------------------------------------------------------------- 1 | select player_id, min(event_date) as first_login 2 | from Activity 3 | group by player_id -------------------------------------------------------------------------------- /database/_512.sql: -------------------------------------------------------------------------------- 1 | select player_id, device_id from Activity where 2 | (player_id, event_date) 3 | in 4 | (select player_id, min(event_date) from Activity group by player_id); -------------------------------------------------------------------------------- /database/_534.sql: -------------------------------------------------------------------------------- 1 | select a1.player_id, a1.event_date, sum(a2.games_played) as games_played_so_far from Activity a1 2 | inner join Activity a2 3 | on a1.player_id = a2.player_id and a1.event_date >= a2.event_date 4 | group by a1.player_id, a1.event_date; -------------------------------------------------------------------------------- /database/_569.sql: -------------------------------------------------------------------------------- 1 | select Id, Company, Salary from 2 | ( 3 | select e.Id, e.Salary, e.Company, if( @prev = e.Company , @Rank := @Rank + 1, @Rank := 1) as rank, @prev := e.Company 4 | from Employee e , (select @Rank := 0, @prev := 0) as temp order by e.Company, e.Salary, e.Id 5 | ) Ranking 6 | INNER JOIN 7 | ( 8 | select count(*) as totalcount, Company as name from Employee e2 group by e2.Company 9 | ) companycount 10 | on companycount.name = Ranking.Company 11 | where Rank = floor((totalcount+1)/2) or Rank = floor((totalcount+2)/2) -------------------------------------------------------------------------------- /database/_570.sql: -------------------------------------------------------------------------------- 1 | select Name from Employee as Name where Id in 2 | (select ManagerId from Employee group by ManagerId having count(*) >= 5) 3 | ; -------------------------------------------------------------------------------- /database/_571.sql: -------------------------------------------------------------------------------- 1 | select FORMAT(avg(n.Number),4)*1.0 as median 2 | from Numbers n left join 3 | ( 4 | select Number, @prev := @count as prevNumber, (@count := @count + Frequency) as countNumber 5 | from Numbers, 6 | (select @count := 0, @prev := 0, @total := (select sum(Frequency) from Numbers)) temp order by Number 7 | ) n2 8 | on n.Number = n2.Number 9 | where 10 | (prevNumber < floor((@total+1)/2) and countNumber >= floor((@total+1)/2)) 11 | or 12 | (prevNumber < floor((@total+2)/2) and countNumber >= floor((@total+2)/2)) -------------------------------------------------------------------------------- /database/_574.sql: -------------------------------------------------------------------------------- 1 | select Name from Candidate as Name where id = 2 | (select CandidateId from Vote group by CandidateId order by count(CandidateId) desc limit 1); -------------------------------------------------------------------------------- /database/_577.sql: -------------------------------------------------------------------------------- 1 | select name, bonus from 2 | (Employee left join Bonus on Employee.empId = Bonus.empId) 3 | where (bonus < 1000 or bonus is null); -------------------------------------------------------------------------------- /database/_578.sql: -------------------------------------------------------------------------------- 1 | SELECT question_id AS 'survey_log' FROM survey_log GROUP BY question_id ORDER BY 2 | COUNT(answer_id) / COUNT(case when survey_log.action = 3 | 'show' then survey_log.action else null end) DESC LIMIT 0,1 -------------------------------------------------------------------------------- /database/_580.sql: -------------------------------------------------------------------------------- 1 | select d.dept_name, count(s.student_id) as student_number 2 | from department d left join student s on d.dept_id = s.dept_id 3 | group by d.dept_name 4 | order by student_number desc, d.dept_name; -------------------------------------------------------------------------------- /database/_584.sql: -------------------------------------------------------------------------------- 1 | select c.name from customer c where c.referee_id != 2 or c.referee_id is NULL; 2 | 3 | /**MySQL uses three-valued logic -- TRUE, FALSE and UNKNOWN. 4 | Anything compared to NULL evaluates to the third value: UNKNOWN. 5 | That “anything” includes NULL itself! 6 | That’s why MySQL provides the IS NULL and IS NOT NULL operators to specifically check for NULL. 7 | Thus, one more condition 'referee_id IS NULL' should be added to the WHERE clause as below.*/ 8 | 9 | /**Cool! I'm glad that I figured this one out all by myself! ^ ^*/ -------------------------------------------------------------------------------- /database/_585.sql: -------------------------------------------------------------------------------- 1 | select sum(TIV_2016) as TIV_2016 2 | from insurance a where 3 | ( 4 | 1 = (select count(*) from insurance b where a.LAT = b.LAT and a.LON = b.LON) 5 | and 6 | 1 < (select count(*) from insurance c where a.TIV_2015 = c.TIV_2015) 7 | ) 8 | ; -------------------------------------------------------------------------------- /database/_586.sql: -------------------------------------------------------------------------------- 1 | SELECT customer_number 2 | FROM orders GROUP BY customer_number 3 | ORDER BY COUNT(*) DESC LIMIT 1; -------------------------------------------------------------------------------- /database/_595.sql: -------------------------------------------------------------------------------- 1 | select name, population, area from World where area > 3000000 or population > 25000000; -------------------------------------------------------------------------------- /database/_596.sql: -------------------------------------------------------------------------------- 1 | select class from courses 2 | group by class 3 | having count(distinct student) >= 5; -------------------------------------------------------------------------------- /database/_597.sql: -------------------------------------------------------------------------------- 1 | select 2 | round( 3 | ifnull( 4 | (select count(distinct requester_id,accepter_id) from request_accepted) 5 | / 6 | (select count(distinct sender_id, send_to_id) from friend_request) 7 | ,0) 8 | ,2) 9 | as accept_rate; 10 | 11 | --The divisor (total number of requests) could be '0' 12 | --if the table friend_request is empty. 13 | --So, we have to utilize ifnull to deal with this special case. -------------------------------------------------------------------------------- /database/_601.sql: -------------------------------------------------------------------------------- 1 | SELECT s1.* FROM stadium AS s1, stadium AS s2, stadium as s3 2 | WHERE 3 | ((s1.id + 1 = s2.id 4 | AND s1.id + 2 = s3.id) 5 | OR 6 | (s1.id - 1 = s2.id 7 | AND s1.id + 1 = s3.id) 8 | OR 9 | (s1.id - 2 = s2.id 10 | AND s1.id - 1 = s3.id) 11 | ) 12 | AND s1.people>=100 13 | AND s2.people>=100 14 | AND s3.people>=100 15 | 16 | GROUP BY s1.id -------------------------------------------------------------------------------- /database/_602.sql: -------------------------------------------------------------------------------- 1 | select id, count(*) num from 2 | ( 3 | (select requester_id id from request_accepted) 4 | union all 5 | (select accepter_id id from request_accepted) 6 | ) as A 7 | group by id order by num desc limit 1; -------------------------------------------------------------------------------- /database/_603.sql: -------------------------------------------------------------------------------- 1 | select c.seat_id from cinema c where c.free = 1 2 | and 3 | ( 4 | c.seat_id+1 in (select seat_id from cinema where free=1) 5 | or 6 | c.seat_id-1 in (select seat_id from cinema where free=1) 7 | ) 8 | order by c.seat_id 9 | -------------------------------------------------------------------------------- /database/_607.sql: -------------------------------------------------------------------------------- 1 | select name from salesperson where sales_id not in 2 | (select sales_id from orders where com_id = 3 | (select com_id from company where company.name = 'RED' 4 | )); -------------------------------------------------------------------------------- /database/_608.sql: -------------------------------------------------------------------------------- 1 | --credit: https://leetcode.com/articles/tree-node/#approach-i-using-union-accepted 2 | select id, 'Root' as Type from tree where p_id is null 3 | union 4 | select id, 'Leaf' as Type from tree where id not in 5 | (select distinct p_id from tree 6 | where p_id is not null) 7 | and p_id is not null 8 | union 9 | select id, 'Inner' as Type from tree where id in 10 | (select distinct p_id from tree 11 | where p_id is not null) 12 | and p_id is not null 13 | order by id; 14 | -------------------------------------------------------------------------------- /database/_610.sql: -------------------------------------------------------------------------------- 1 | select x, y, z, 2 | case when x+y <= z or 3 | x+z <= y or 4 | y+z <= x 5 | then "No" 6 | else "Yes" 7 | end as "triangle" 8 | from triangle; -------------------------------------------------------------------------------- /database/_612.sql: -------------------------------------------------------------------------------- 1 | select round(sqrt(min(power(p1.x - p2.x, 2) + power(p1.y - p2.y, 2))), 2) as shortest 2 | from point_2d as p1 3 | join point_2d as p2 4 | where p1.x <> p2.x or p1.y <> p2.y;--it should be OR here instead of AND -------------------------------------------------------------------------------- /database/_613.sql: -------------------------------------------------------------------------------- 1 | select min(abs(p1.x - p2.x)) as shortest from point p1 2 | join point p2 where p1.x <> p2.x; -------------------------------------------------------------------------------- /database/_614.sql: -------------------------------------------------------------------------------- 1 | select f1.follower, count(distinct f2.follower) as num 2 | from follow f1 3 | inner join follow f2 on f1.follower = f2.followee 4 | group by f1.follower -------------------------------------------------------------------------------- /database/_615.sql: -------------------------------------------------------------------------------- 1 | SELECT d1.pay_month, d1.department_id, 2 | CASE WHEN d1.department_avg > c1.company_avg THEN 'higher' 3 | WHEN d1.department_avg < c1.company_avg THEN 'lower' 4 | ELSE 'same' 5 | END AS 'comparison' 6 | FROM ((SELECT LEFT(s1.pay_date, 7) pay_month, e1.department_id, AVG(s1.amount) department_avg 7 | FROM salary s1 8 | JOIN employee e1 ON s1.employee_id = e1.employee_id 9 | GROUP BY pay_month, e1.department_id) d1 10 | LEFT JOIN (SELECT LEFT(pay_date, 7) pay_month, AVG(amount) company_avg 11 | FROM salary 12 | GROUP BY pay_month) c1 ON d1.pay_month = c1.pay_month) 13 | ORDER BY pay_month DESC, department_id; 14 | -------------------------------------------------------------------------------- /database/_619.sql: -------------------------------------------------------------------------------- 1 | SELECT MAX(num) AS num 2 | FROM 3 | (SELECT num FROM number 4 | GROUP BY num 5 | HAVING COUNT(num) = 1) AS t; -------------------------------------------------------------------------------- /database/_620.sql: -------------------------------------------------------------------------------- 1 | select id, movie, description, rating 2 | from cinema where mod (id, 2) = 1 3 | and description not like 'boring' 4 | order by rating desc; -------------------------------------------------------------------------------- /database/_626.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | (CASE 3 | WHEN MOD(id, 2) != 0 AND counts != id THEN id + 1 4 | WHEN MOD(id, 2) != 0 AND counts = id THEN id 5 | ELSE id - 1 6 | END) AS id, 7 | student 8 | FROM 9 | seat, 10 | (SELECT 11 | COUNT(*) AS counts 12 | FROM 13 | seat) AS seat_counts 14 | ORDER BY id ASC; -------------------------------------------------------------------------------- /database/_627.sql: -------------------------------------------------------------------------------- 1 | --solution 1: 2 | update salary 3 | set sex = CHAR(ASCII('f') ^ ASCII('m') ^ ASCII(sex)); 4 | 5 | --solution 2: 6 | update salary 7 | set sex = case sex 8 | when 'm' then 'f' 9 | else 'm' 10 | end; 11 | 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishercoder1534/Leetcode/dd67dd385c03586cb9169e82b10d9a7149dfa587/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /javascript/_1.js: -------------------------------------------------------------------------------- 1 | // Two sum 2 | 3 | var twoSum = function (nums, target) { 4 | var sum = {} 5 | for (var i = 0; i < nums.length; i++) { 6 | if (!Object.prototype.hasOwnProperty.call(sum, (target - nums[i]))) { 7 | sum[nums[i]] = i 8 | } else { 9 | return [i, sum[target - nums[i]]] 10 | } 11 | } 12 | } 13 | 14 | console.log(twoSum([2, 7, 11, 15], 9)) 15 | -------------------------------------------------------------------------------- /javascript/_10.js: -------------------------------------------------------------------------------- 1 | 2 | var isMatch = function (s, p) { 3 | return (new RegExp('^' + p + '$')).test(s) 4 | } 5 | 6 | console.log(isMatch('aa', 'a*')) 7 | -------------------------------------------------------------------------------- /javascript/_1295.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {number[]} nums 3 | * @return {number} 4 | */ 5 | 6 | var findNumbers = function (nums) { 7 | let result = 0 8 | for (let i = 0; i < nums.length; i++) { 9 | const num = String(nums[i]) 10 | if (num.length % 2 === 0) result++ 11 | } 12 | return result 13 | } 14 | 15 | console.log(findNumbers([12, 345, 2, 6, 7896])) 16 | -------------------------------------------------------------------------------- /javascript/_1637.js: -------------------------------------------------------------------------------- 1 | // Author: Phuong Lam 2 | 3 | /** 4 | * @param {number[][]} points 5 | * @return {number} 6 | */ 7 | var maxWidthOfVerticalArea = function(points) { 8 | const sortedX = points 9 | .map((point) => { 10 | return point[0] 11 | }) 12 | .sort((a, b) => { 13 | if (a < b) return -1 14 | if (a > b) return 1 15 | return 0 16 | }) 17 | var max = 0 18 | for (let i = 0; i < sortedX.length - 1; i++) { 19 | const d = sortedX[i + 1] - sortedX[i] 20 | if (d > max) max = d 21 | } 22 | return max 23 | }; -------------------------------------------------------------------------------- /javascript/_1658.js: -------------------------------------------------------------------------------- 1 | // Author: Phuong Lam 2 | 3 | /** 4 | * @param {number[]} nums 5 | * @param {number} x 6 | * @return {number} 7 | */ 8 | var minOperations = function (nums, x) { 9 | const total = nums.reduce((a, b) => a + b) 10 | if (total === x) return nums.length 11 | 12 | var sum = 0 13 | var head = 0 14 | var max = -1 15 | for (var tail = 0; tail < nums.length; tail++) { 16 | sum += nums[tail] 17 | while (sum > total - x) { 18 | sum -= nums[head] 19 | head++ 20 | } 21 | if (sum === total - x) max = Math.max(max, tail - head + 1) 22 | } 23 | 24 | return max === -1 ? -1 : nums.length - max 25 | } 26 | -------------------------------------------------------------------------------- /javascript/_167.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {number[]} numbers 3 | * @param {number} target 4 | * @return {number[]} 5 | */ 6 | var twoSum = function (numbers, target) { 7 | var p1 = 0 8 | var p2 = numbers.length - 1 9 | 10 | while (p1 < p2) { 11 | if (numbers[p1] + numbers[p2] < target) { 12 | p1 += 1 13 | } else if (numbers[p1] + numbers[p2] > target) { 14 | p2 -= 1 15 | } else { 16 | return [p1 + 1, p2 + 1] 17 | } 18 | } 19 | return [-1, -1] 20 | } 21 | 22 | console.log(twoSum([2, 7, 11, 15], 9)) 23 | -------------------------------------------------------------------------------- /javascript/_2619.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @return {null|boolean|number|string|Array|Object} 3 | */ 4 | Array.prototype.last = function () { 5 | if (this.length === 0) { 6 | return -1; 7 | } 8 | return this[this.length - 1]; 9 | }; 10 | 11 | /** 12 | * const arr = [1, 2, 3]; 13 | * arr.last(); // 3 14 | */ -------------------------------------------------------------------------------- /javascript/_2620.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {number} n 3 | * @return {Function} counter 4 | */ 5 | var createCounter = function (n) { 6 | let counter = n; 7 | 8 | return function () { 9 | return n++; 10 | }; 11 | }; 12 | 13 | /** 14 | * const counter = createCounter(10) 15 | * counter() // 10 16 | * counter() // 11 17 | * counter() // 12 18 | */ -------------------------------------------------------------------------------- /javascript/_2703.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {...(null|boolean|number|string|Array|Object)} args 3 | * @return {number} 4 | */ 5 | var argumentsLength = function (...args) { 6 | return args.length; 7 | }; -------------------------------------------------------------------------------- /javascript/_485.js: -------------------------------------------------------------------------------- 1 | var findMaxConsecutiveOnes = function (nums) { 2 | let slow = 0 3 | let fast = 0 4 | let max = 0 5 | while (fast < nums.length) { 6 | if (nums[fast] === 0) { 7 | if (fast - slow > max) { 8 | max = fast - slow 9 | } 10 | fast++ 11 | slow = fast 12 | } else { 13 | fast++ 14 | } 15 | } 16 | return fast - slow > max ? fast - slow : max 17 | } 18 | 19 | console.log(findMaxConsecutiveOnes([2, 7, 11, 15])) 20 | -------------------------------------------------------------------------------- /python3/2001.py: -------------------------------------------------------------------------------- 1 | from fractions import * 2 | from collections import Counter 3 | 4 | class Solution: 5 | #credit: https://leetcode-cn.com/u/lucifer1004/ 6 | def interchangeableRectangles(self, rectangles: List[List[int]]) -> int: 7 | cnt = Counter() 8 | for w, h in rectangles: 9 | cnt[Fraction(w, h)] += 1 10 | ans = 0 11 | for value in cnt.values(): 12 | ans += value * (value - 1) // 2 13 | return ans -------------------------------------------------------------------------------- /python3/2879.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | def selectFirstRows(employees: pd.DataFrame) -> pd.DataFrame: 4 | return employees.head(3) -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'leetcode-algorithms' 2 | -------------------------------------------------------------------------------- /shell/TenthLine.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #How would you print just the 10th line of a file? 4 | # 5 | #For example, assume that file.txt has the following content: 6 | # 7 | #Line 1 8 | #Line 2 9 | #Line 3 10 | #Line 4 11 | #Line 5 12 | #Line 6 13 | #Line 7 14 | #Line 8 15 | #Line 9 16 | #Line 10 17 | #Your script should output the tenth line, which is: 18 | #Line 10 19 | #[show hint] 20 | # 21 | #Hint: 22 | #1. If the file contains less than 10 lines, what should you output? 23 | #2. There's at least three different solutions. Try to explore all possibilities. 24 | 25 | awk 'NR == 10' file.txt -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/common/classes/BinaryMatrix.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.common.classes; 2 | 3 | import java.util.List; 4 | 5 | public interface BinaryMatrix { 6 | int get(int x, int y); 7 | 8 | List dimensions(); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/common/classes/Point.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.common.classes; 2 | 3 | /* 4 | * Created by fishercoder on 12/31/16. 5 | */ 6 | public class Point { 7 | public int x; 8 | public int y; 9 | 10 | public Point() { 11 | x = 0; 12 | y = 0; 13 | } 14 | 15 | public Point(int a, int b) { 16 | this.x = a; 17 | this.y = b; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/common/classes/Reader4.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.common.classes; 2 | 3 | public class Reader4 { 4 | public int read4(char[] buf) { 5 | if (buf.length < 4) { 6 | return buf.length; 7 | } else { 8 | return 4; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_100.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | import com.fishercoder.common.classes.TreeNode; 4 | 5 | public class _100 { 6 | public static class Solution1 { 7 | public boolean isSameTree(TreeNode p, TreeNode q) { 8 | if (p == null || q == null) { 9 | return p == q; 10 | } 11 | return p.val == q.val && isSameTree(p.left, q.left) && isSameTree(p.right, q.right); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_233.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _233 { 4 | public static class Solution1 { 5 | public int countDigitOne(int n) { 6 | int count = 0; 7 | for (long k = 1; k <= n; k *= 10) { 8 | long r = n / k; 9 | long m = n % k; 10 | // sum up the count of ones on every place k 11 | count += (r + 8) / 10 * k + (r % 10 == 1 ? m + 1 : 0); 12 | } 13 | return count; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_237.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | import com.fishercoder.common.classes.ListNode; 4 | 5 | public class _237 { 6 | 7 | public static class Solution1 { 8 | public void deleteNode(ListNode node) { 9 | node.val = node.next.val; 10 | node.next = node.next.next; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_258.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _258 { 4 | 5 | public static class Solution1 { 6 | // only three cases as the code shows 7 | public int addDigits(int num) { 8 | if (num == 0) { 9 | return 0; 10 | } 11 | if (num % 9 == 0) { 12 | return 9; 13 | } 14 | return num % 9; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_263.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _263 { 4 | 5 | public static class Solution1 { 6 | public boolean isUgly(int num) { 7 | if (num == 0) { 8 | return false; 9 | } 10 | int[] divisors = new int[] {5, 3, 2}; 11 | for (int divisor : divisors) { 12 | while (num % divisor == 0) { 13 | num /= divisor; 14 | } 15 | } 16 | return num == 1; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_27.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _27 { 4 | 5 | public static class Solution1 { 6 | public int removeElement(int[] nums, int val) { 7 | int i = 0; 8 | for (int j = 0; j < nums.length; j++) { 9 | if (nums[j] != val) { 10 | nums[i++] = nums[j]; 11 | } 12 | } 13 | return i; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_319.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _319 { 4 | 5 | public static class Solution1 { 6 | public int bulbSwitch(int n) { 7 | if (n < 2) { 8 | return n; 9 | } 10 | return (int) Math.sqrt(n); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_344.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _344 { 4 | public static class Solution1 { 5 | public void reverseString(char[] s) { 6 | for (int left = 0, right = s.length - 1; left < right; left++, right--) { 7 | char tmp = s[left]; 8 | s[left] = s[right]; 9 | s[right] = tmp; 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_367.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _367 { 4 | 5 | public static class Solution1 { 6 | public boolean isPerfectSquare(int num) { 7 | long i = 1; 8 | long temp = 1; 9 | while (temp < num) { 10 | i += 2; 11 | temp += i; 12 | } 13 | return temp == num; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_371.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _371 { 4 | 5 | public static class Solution1 { 6 | /* 7 | * reference: http://stackoverflow.com/questions/9070937/adding-two-numbers-without-operator-clarification 8 | */ 9 | public int getSum(int a, int b) { 10 | if (b == 0) { 11 | return a; 12 | } 13 | int sum = a ^ b; 14 | int carry = (a & b) << 1; 15 | return getSum(sum, carry); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_387.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _387 { 4 | public static class Solution1 { 5 | public static int firstUniqChar(String s) { 6 | int[] freq = new int[26]; 7 | for (int i = 0; i < s.length(); i++) { 8 | freq[s.charAt(i) - 'a']++; 9 | } 10 | for (int i = 0; i < s.length(); i++) { 11 | if (freq[s.charAt(i) - 'a'] == 1) { 12 | return i; 13 | } 14 | } 15 | return -1; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_458.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _458 { 4 | 5 | public static class Solution1 { 6 | public int poorPigs(int buckets, int minutesToDie, int minutesToTest) { 7 | if (buckets-- == 1) { 8 | return 0; 9 | } 10 | int base = minutesToTest / minutesToDie + 1; 11 | int count = 0; 12 | while (buckets > 0) { 13 | buckets /= base; 14 | count++; 15 | } 16 | return count; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_504.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _504 { 4 | 5 | public static class Solution1 { 6 | public String convertToBase7(int num) { 7 | return String.valueOf(Integer.toString(num, 7)); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_518.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _518 { 4 | public static class Solution1 { 5 | public int change(int amount, int[] coins) { 6 | int[] ways = new int[amount + 1]; 7 | ways[0] = 1; 8 | for (int denom : coins) { 9 | for (int i = 0; i < ways.length; i++) { 10 | if (denom <= i) { 11 | ways[i] += ways[i - denom]; 12 | } 13 | } 14 | } 15 | return ways[amount]; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_561.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _561 { 6 | 7 | public static class Solution1 { 8 | public int arrayPairSum(int[] nums) { 9 | Arrays.sort(nums); 10 | int sum = 0; 11 | for (int i = 0; i < nums.length; i += 2) { 12 | sum += nums[i]; 13 | } 14 | return sum; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_575.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class _575 { 7 | public static class Solution1 { 8 | public int distributeCandies(int[] candyType) { 9 | Set map = new HashSet<>(); 10 | for (int candy : candyType) { 11 | map.add(candy); 12 | } 13 | return Math.min(map.size(), candyType.length / 2); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_58.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _58 { 4 | 5 | public static class Solution1 { 6 | public int lengthOfLastWord(String s) { 7 | if (s == null || s.length() == 0) { 8 | return 0; 9 | } 10 | s = s.trim(); 11 | int n = s.length() - 1; 12 | while (n >= 0 && s.charAt(n) != ' ') { 13 | n--; 14 | } 15 | return s.length() - n - 1; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_717.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _717 { 4 | public static class Solution1 { 5 | public boolean isOneBitCharacter(int[] bits) { 6 | int n = bits.length; 7 | int i = 0; 8 | while (i < n - 1) { 9 | if (bits[i] == 0) { 10 | i++; 11 | } else { 12 | i += 2; 13 | } 14 | } 15 | return i == n - 1 ? true : false; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_746.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _746 { 4 | public static class Solution1 { 5 | public int minCostClimbingStairs(int[] cost) { 6 | int[] dp = new int[cost.length]; 7 | dp[0] = cost[0]; 8 | dp[1] = cost[1]; 9 | for (int i = 2; i < cost.length; i++) { 10 | dp[i] = cost[i] + Math.min(dp[i - 1], dp[i - 2]); 11 | } 12 | return Math.min(dp[cost.length - 1], dp[cost.length - 2]); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_749.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _749 { 4 | public static class Solution1 { 5 | // TODO: implement it 6 | public int containVirus(int[][] grid) { 7 | return -1; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_751.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | import java.util.List; 4 | 5 | public class _751 { 6 | public static class Solution1 { 7 | public List ipToCIDR(String ip, int n) { 8 | // TODO: implement it 9 | return null; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_760.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _760 { 4 | public static class Solution1 { 5 | public int[] anagramMappings(int[] A, int[] B) { 6 | int[] result = new int[A.length]; 7 | for (int i = 0; i < A.length; i++) { 8 | for (int j = 0; j < B.length; j++) { 9 | if (A[i] == B[j]) { 10 | result[i] = j; 11 | } 12 | } 13 | } 14 | return result; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_766.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _766 { 4 | public static class Solution1 { 5 | public boolean isToeplitzMatrix(int[][] matrix) { 6 | int m = matrix.length; 7 | int n = matrix[0].length; 8 | for (int i = 1; i < m; i++) { 9 | for (int j = 1; j < n; j++) { 10 | if (matrix[i][j] != matrix[i - 1][j - 1]) { 11 | return false; 12 | } 13 | } 14 | } 15 | return true; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_796.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _796 { 4 | public static class Solution1 { 5 | public boolean rotateString(String A, String B) { 6 | if (A.length() != B.length()) { 7 | return false; 8 | } 9 | for (int i = 0; i < A.length(); i++) { 10 | if ((A.substring(i) + A.substring(0, i)).equals(B)) { 11 | return true; 12 | } 13 | } 14 | return false; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_836.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _836 { 4 | public static class Solution1 { 5 | /* 6 | * credit: https://leetcode.com/problems/rectangle-overlap/discuss/132340/C%2B%2BJavaPython-1-line-Solution-1D-to-2D 7 | */ 8 | public boolean isRectangleOverlap(int[] rec1, int[] rec2) { 9 | return rec1[0] < rec2[2] && rec2[0] < rec1[2] && rec1[1] < rec2[3] && rec2[1] < rec1[3]; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_847.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _847 { 4 | public static class Solution1 { 5 | public int shortestPathLength(int[][] graph) { 6 | // TODO: implement this 7 | return -1; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_852.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _852 { 4 | public static class Solution1 { 5 | public int peakIndexInMountainArray(int[] A) { 6 | for (int i = 1; i < A.length - 1; i++) { 7 | if (A[i] > A[i + 1]) { 8 | return i; 9 | } 10 | } 11 | return -1; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_867.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _867 { 4 | public static class Solution1 { 5 | public int[][] transpose(int[][] matrix) { 6 | int[][] result = new int[matrix[0].length][matrix.length]; 7 | for (int i = 0; i < matrix.length; i++) { 8 | for (int j = 0; j < matrix[0].length; j++) { 9 | result[j][i] = matrix[i][j]; 10 | } 11 | } 12 | return result; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_876.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | import com.fishercoder.common.classes.ListNode; 4 | 5 | public class _876 { 6 | public static class Solution1 { 7 | public ListNode middleNode(ListNode head) { 8 | ListNode fast = head; 9 | ListNode slow = head; 10 | while (fast != null && fast.next != null) { 11 | fast = fast.next.next; 12 | slow = slow.next; 13 | } 14 | return slow; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_880.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _880 { 4 | public static class Solution1 { 5 | public String decodeAtIndex(String S, int K) { 6 | // TODO: implement it 7 | return ""; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_96.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _96 { 4 | 5 | public static class Solution1 { 6 | public int numTrees(int n) { 7 | int[] G = new int[n + 1]; 8 | G[0] = G[1] = 1; 9 | 10 | for (int i = 2; i <= n; ++i) { 11 | for (int j = 1; j <= i; ++j) { 12 | int temp = G[j - 1] * G[i - j]; 13 | G[i] = G[i] + temp; 14 | } 15 | } 16 | return G[n]; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_961.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class _961 { 7 | public static class Solution1 { 8 | public int repeatedNTimes(int[] A) { 9 | Set set = new HashSet<>(); 10 | for (int num : A) { 11 | if (!set.add(num)) { 12 | return num; 13 | } 14 | } 15 | return -1; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_976.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _976 { 6 | 7 | public static class Solution1 { 8 | public int largestPerimeter(int[] A) { 9 | Arrays.sort(A); 10 | int n = A.length; 11 | 12 | for (int i = n - 1; i > 1; i--) { 13 | if (A[i] < A[i - 1] + A[i - 2]) { 14 | return A[i] + A[i - 1] + A[i - 2]; 15 | } 16 | } 17 | 18 | return 0; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/firstthousand/_991.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.firstthousand; 2 | 3 | public class _991 { 4 | public static class Solution1 { 5 | public int brokenCalc(int X, int Y) { 6 | int ops = 0; 7 | while (Y > X) { 8 | ops++; 9 | if (Y % 2 != 0) { 10 | Y++; 11 | } else { 12 | Y /= 2; 13 | } 14 | } 15 | return ops + X - Y; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3010.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | import java.util.PriorityQueue; 4 | 5 | public class _3010 { 6 | public static class Solution1 { 7 | public int minimumCost(int[] nums) { 8 | PriorityQueue minHeap = new PriorityQueue<>(); 9 | for (int i = 1; i < nums.length; i++) { 10 | minHeap.offer(nums[i]); 11 | } 12 | return nums[0] + minHeap.poll() + minHeap.poll(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3019.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3019 { 4 | public static class Solution1 { 5 | public int countKeyChanges(String s) { 6 | int ans = 0; 7 | for (int i = 1; i < s.length(); i++) { 8 | if (Character.toLowerCase(s.charAt(i - 1)) != Character.toLowerCase(s.charAt(i))) { 9 | ans++; 10 | } 11 | } 12 | return ans; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3028.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3028 { 4 | public static class Solution1 { 5 | public int returnToBoundaryCount(int[] nums) { 6 | int ans = 0; 7 | int pos = 0; 8 | for (int i = 0; i < nums.length; i++) { 9 | pos += nums[i]; 10 | if (pos == 0) { 11 | ans++; 12 | } 13 | } 14 | return ans; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3046.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class _3046 { 7 | public static class Solution1 { 8 | public boolean isPossibleToSplit(int[] nums) { 9 | Map map = new HashMap<>(); 10 | for (int num : nums) { 11 | map.put(num, map.getOrDefault(num, 0) + 1); 12 | if (map.get(num) > 2) { 13 | return false; 14 | } 15 | } 16 | return true; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3099.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3099 { 4 | public static class Solution1 { 5 | public int sumOfTheDigitsOfHarshadNumber(int x) { 6 | int sum = 0; 7 | int tmp = x; 8 | while (tmp != 0) { 9 | sum += tmp % 10; 10 | tmp /= 10; 11 | } 12 | return x % sum == 0 ? sum : -1; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3110.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3110 { 4 | public static class Solution1 { 5 | public int scoreOfString(String s) { 6 | int score = 0; 7 | for (int i = 0; i < s.length() - 1; i++) { 8 | int asciiVal1 = s.charAt(i); 9 | int asciiVal2 = s.charAt(i + 1); 10 | score += Math.abs(asciiVal1 - asciiVal2); 11 | } 12 | return score; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3131.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _3131 { 6 | public static class Solution1 { 7 | public int addedInteger(int[] nums1, int[] nums2) { 8 | Arrays.sort(nums1); 9 | Arrays.sort(nums2); 10 | return nums2[0] - nums1[0]; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3151.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3151 { 4 | public static class Solution1 { 5 | public boolean isArraySpecial(int[] nums) { 6 | for (int i = 1; i < nums.length; i++) { 7 | if (nums[i - 1] % 2 == nums[i] % 2) { 8 | return false; 9 | } 10 | } 11 | return true; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3158.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class _3158 { 7 | public static class Solution1 { 8 | public int duplicateNumbersXOR(int[] nums) { 9 | int ans = 0; 10 | Set met = new HashSet<>(); 11 | for (int num : nums) { 12 | if (!met.add(num)) { 13 | ans ^= num; 14 | } 15 | } 16 | return ans; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3162.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3162 { 4 | public static class Solution1 { 5 | public int numberOfPairs(int[] nums1, int[] nums2, int k) { 6 | int count = 0; 7 | for (int i = 0; i < nums1.length; i++) { 8 | for (int j = 0; j < nums2.length; j++) { 9 | if (nums1[i] % (nums2[j] * k) == 0) { 10 | count++; 11 | } 12 | } 13 | } 14 | return count; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3168.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3168 { 4 | public static class Solution1 { 5 | public int minimumChairs(String s) { 6 | int seated = 0; 7 | int seats = 0; 8 | for (char c : s.toCharArray()) { 9 | if (c == 'E') { 10 | seated++; 11 | } else { 12 | seated--; 13 | } 14 | seats = Math.max(seated, seats); 15 | } 16 | return seats; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3173.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3173 { 4 | public static class Solution1 { 5 | public int[] orArray(int[] nums) { 6 | int[] result = new int[nums.length - 1]; 7 | for (int i = 1; i < nums.length; i++) { 8 | result[i - 1] = nums[i] | nums[i - 1]; 9 | } 10 | return result; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3184.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3184 { 4 | public static class Solution1 { 5 | public int countCompleteDayPairs(int[] hours) { 6 | int count = 0; 7 | for (int i = 0; i < hours.length - 1; i++) { 8 | for (int j = i + 1; j < hours.length; j++) { 9 | if ((hours[i] + hours[j]) % 24 == 0) { 10 | count++; 11 | } 12 | } 13 | } 14 | return count; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3190.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3190 { 4 | public static class Solution1 { 5 | public int minimumOperations(int[] nums) { 6 | int ops = 0; 7 | for (int num : nums) { 8 | if (num % 3 != 0) { 9 | ops++; 10 | } 11 | } 12 | return ops; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3210.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3210 { 4 | public static class Solution1 { 5 | public String getEncryptedString(String s, int k) { 6 | StringBuilder sb = new StringBuilder(); 7 | for (int i = 0; i < s.length(); i++) { 8 | sb.append(s.charAt((i + k) % s.length())); 9 | } 10 | return sb.toString(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3222.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3222 { 4 | public static class Solution1 { 5 | public String losingPlayer(int x, int y) { 6 | boolean bobsTurn = true; 7 | while (x >= 1 && y >= 4) { 8 | x--; 9 | y -= 4; 10 | bobsTurn = !bobsTurn; 11 | } 12 | return !bobsTurn ? "Alice" : "Bob"; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3280.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3280 { 4 | public static class Solution1 { 5 | public String convertDateToBinary(String date) { 6 | String[] parts = date.split("-"); 7 | StringBuilder sb = new StringBuilder(); 8 | for (String part : parts) { 9 | sb.append(Integer.toBinaryString(Integer.parseInt(part))); 10 | sb.append("-"); 11 | } 12 | sb.setLength(sb.length() - 1); 13 | return sb.toString(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3285.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class _3285 { 7 | public static class Solution1 { 8 | public List stableMountains(int[] height, int threshold) { 9 | List ans = new ArrayList<>(); 10 | for (int i = 1; i < height.length; i++) { 11 | if (height[i - 1] > threshold) { 12 | ans.add(i); 13 | } 14 | } 15 | return ans; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3289.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class _3289 { 7 | public static class Solution1 { 8 | public int[] getSneakyNumbers(int[] nums) { 9 | int[] ans = new int[2]; 10 | Set set = new HashSet<>(); 11 | int i = 0; 12 | for (int num : nums) { 13 | if (!set.add(num)) { 14 | ans[i++] = num; 15 | } 16 | } 17 | return ans; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3304.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3304 { 4 | public static class Solution1 { 5 | public char kthCharacter(int k) { 6 | StringBuilder sb = new StringBuilder("a"); 7 | while (sb.length() <= k) { 8 | int n = sb.length(); 9 | for (int i = 0; i < n; i++) { 10 | sb.append((char) (sb.charAt(i) + 1)); 11 | } 12 | } 13 | return sb.charAt(k - 1); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3330.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3330 { 4 | public static class Solution1 { 5 | public int possibleStringCount(String word) { 6 | int ans = 1; 7 | for (int i = 1; i < word.length(); i++) { 8 | if (word.charAt(i) == word.charAt(i - 1)) { 9 | ans++; 10 | } 11 | } 12 | return ans; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3360.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3360 { 4 | public static class Solution1 { 5 | public boolean canAliceWin(int n) { 6 | int turns = 0; 7 | int removeCount = 10; 8 | while (n >= removeCount) { 9 | n -= removeCount; 10 | removeCount--; 11 | turns++; 12 | } 13 | return turns % 2 != 0; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3392.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3392 { 4 | public static class Solution1 { 5 | public int countSubarrays(int[] nums) { 6 | int count = 0; 7 | for (int i = 0; i < nums.length - 2; i++) { 8 | if ((nums[i] + nums[i + 2]) * 2 == nums[i + 1]) { 9 | count++; 10 | } 11 | } 12 | return count; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3491.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3491 { 4 | public static class Solution1 { 5 | public boolean phonePrefix(String[] numbers) { 6 | for (int i = 0; i < numbers.length; i++) { 7 | for (int j = 0; j < numbers.length; j++) { 8 | if (i != j && numbers[i].startsWith(numbers[j])) { 9 | return false; 10 | } 11 | } 12 | } 13 | return true; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/fourththousand/_3502.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.fourththousand; 2 | 3 | public class _3502 { 4 | public static class Solution1 { 5 | public int[] minCosts(int[] cost) { 6 | int[] res = new int[cost.length]; 7 | int min = cost[0]; 8 | for (int i = 0; i < cost.length; i++) { 9 | if (cost[i] < min) { 10 | min = cost[i]; 11 | } 12 | res[i] = min; 13 | } 14 | return res; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1014.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1014 { 4 | public static class Solution1 { 5 | public int maxScoreSightseeingPair(int[] A) { 6 | int bestPrevious = A[0]; 7 | int maxSum = 0; 8 | 9 | for (int i = 1; i < A.length; ++i) { 10 | maxSum = Math.max(maxSum, bestPrevious + A[i] - i); 11 | bestPrevious = Math.max(bestPrevious, A[i] + i); 12 | } 13 | 14 | return maxSum; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1037.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1037 { 4 | public static class Solution1 { 5 | public boolean isBoomerang(int[][] points) { 6 | return (points[1][1] - points[0][1]) * (points[2][0] - points[0][0]) 7 | != (points[2][1] - points[0][1]) * (points[1][0] - points[0][0]); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1049.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1049 { 4 | public static class Solution1 { 5 | public int lastStoneWeightII(int[] stones) { 6 | // TODO: implement it 7 | return 1; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1055.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.stream.IntStream; 4 | 5 | public class _1055 { 6 | public static class Solution1 { 7 | public int fixedPoint(int[] A) { 8 | return IntStream.range(0, A.length).filter(i -> A[i] == i).findFirst().orElse(-1); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1123.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import com.fishercoder.common.classes.TreeNode; 4 | 5 | public class _1123 { 6 | public static class Solution1 { 7 | // TODO: implement it 8 | public TreeNode lcaDeepestLeaves(TreeNode root) { 9 | return null; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1165.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1165 { 4 | public static class Solution1 { 5 | public int calculateTime(String keyboard, String word) { 6 | int time = 0; 7 | int fromIndex = 0; 8 | for (char c : word.toCharArray()) { 9 | int fingerMoves = Math.abs(fromIndex - keyboard.indexOf(c)); 10 | fromIndex = keyboard.indexOf(c); 11 | time += fingerMoves; 12 | } 13 | return time; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1186.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1186 { 4 | public static class Solution1 { 5 | public int maximumSum(int[] arr) { 6 | // TODO: implement it 7 | return -1; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1196.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1196 { 6 | public static class Solution1 { 7 | public int maxNumberOfApples(int[] arr) { 8 | Arrays.sort(arr); 9 | int sum = 0; 10 | int i = 0; 11 | for (; i < arr.length; i++) { 12 | sum += arr[i]; 13 | if (sum > 5000) { 14 | break; 15 | } 16 | } 17 | return i; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1248.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1248 { 4 | public static class Solution1 { 5 | public int numberOfSubarrays(int[] nums, int k) { 6 | for (int i = 0; i < nums.length; i++) { 7 | for (int j = 0; j < nums.length; j++) { 8 | // TODO: implement it 9 | } 10 | } 11 | return -1; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1281.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1281 { 4 | public static class Solution1 { 5 | public int subtractProductAndSum(int n) { 6 | int sum = 0; 7 | int product = 1; 8 | while (n > 0) { 9 | int digit = n % 10; 10 | n /= 10; 11 | sum += digit; 12 | product *= digit; 13 | } 14 | return product - sum; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1287.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1287 { 4 | public static class Solution1 { 5 | public int findSpecialInteger(int[] arr) { 6 | int quarter = arr.length / 4; 7 | for (int i = 0; i < arr.length - quarter; i++) { 8 | if (arr[i] == arr[i + quarter]) { 9 | return arr[i]; 10 | } 11 | } 12 | return -1; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1291.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.List; 4 | 5 | public class _1291 { 6 | public static class Solution1 { 7 | public List sequentialDigits(int low, int high) { 8 | // TODO: implement it 9 | return null; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1332.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1332 { 4 | public static class Solution1 { 5 | /* 6 | * Notice: there are only two characters in the given string: 'a' and 'b' 7 | */ 8 | public int removePalindromeSub(String s) { 9 | if (s.isEmpty()) { 10 | return 0; 11 | } 12 | if (s.equals((new StringBuilder(s)).reverse().toString())) { 13 | return 1; 14 | } 15 | return 2; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1342.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1342 { 4 | public static class Solution1 { 5 | public int numberOfSteps(int num) { 6 | int steps = 0; 7 | while (num != 0) { 8 | if (num % 2 == 0) { 9 | num /= 2; 10 | } else { 11 | num--; 12 | } 13 | steps++; 14 | } 15 | return steps; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1346.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1346 { 4 | public static class Solution1 { 5 | public boolean checkIfExist(int[] arr) { 6 | for (int i = 0; i < arr.length; i++) { 7 | for (int j = 0; j < arr.length; j++) { 8 | if (i != j && (arr[i] * 2 == arr[j] || arr[i] == arr[j] * 2)) { 9 | return true; 10 | } 11 | } 12 | } 13 | return false; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1351.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1351 { 4 | public static class Solution1 { 5 | public int countNegatives(int[][] grid) { 6 | int count = 0; 7 | for (int[] row : grid) { 8 | for (int v : row) { 9 | if (v < 0) { 10 | count++; 11 | } 12 | } 13 | } 14 | return count; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1426.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | import java.util.Set; 5 | import java.util.stream.Collectors; 6 | 7 | public class _1426 { 8 | public static class Solution1 { 9 | public int countElements(int[] arr) { 10 | Set set = Arrays.stream(arr).boxed().collect(Collectors.toSet()); 11 | return (int) Arrays.stream(arr).filter(n -> set.contains(n + 1)).count(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1446.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1446 { 4 | public static class Solution1 { 5 | public int maxPower(String s) { 6 | int max = 0; 7 | for (int i = 0; i < s.length(); i++) { 8 | int start = i; 9 | while (i + 1 < s.length() && s.charAt(i) == s.charAt(i + 1)) { 10 | i++; 11 | } 12 | max = Math.max(max, i - start + 1); 13 | } 14 | return max; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1450.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1450 { 4 | public static class Solution1 { 5 | public int busyStudent(int[] startTime, int[] endTime, int queryTime) { 6 | int count = 0; 7 | for (int i = 0; i < startTime.length; i++) { 8 | if (startTime[i] <= queryTime && endTime[i] >= queryTime) { 9 | count++; 10 | } 11 | } 12 | return count; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1455.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1455 { 4 | public static class Solution1 { 5 | public int isPrefixOfWord(String sentence, String searchWord) { 6 | String[] words = sentence.split(" "); 7 | for (int i = 0; i < words.length; i++) { 8 | if (words[i].startsWith(searchWord)) { 9 | return i + 1; 10 | } 11 | } 12 | return -1; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1470.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1470 { 4 | public static class Solution1 { 5 | public int[] shuffle(int[] nums, int n) { 6 | int[] result = new int[nums.length]; 7 | for (int i = 0, j = 0; i < n && j < 2 * n; i++, j++) { 8 | result[j] = nums[i]; 9 | result[++j] = nums[i + n]; 10 | } 11 | return result; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1480.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1480 { 4 | public static class Solution1 { 5 | public int[] runningSum(int[] nums) { 6 | int sum = 0; 7 | int[] result = new int[nums.length]; 8 | for (int i = 0; i < nums.length; i++) { 9 | sum += nums[i]; 10 | result[i] = sum; 11 | } 12 | return result; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1486.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1486 { 4 | public static class Solution1 { 5 | public int xorOperation(int n, int start) { 6 | int[] nums = new int[n]; 7 | for (int i = 0; i < n; i++) { 8 | nums[i] = start + 2 * i; 9 | } 10 | int result = 0; 11 | for (int num : nums) { 12 | result ^= num; 13 | } 14 | return result; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1492.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class _1492 { 7 | public static class Solution1 { 8 | public int kthFactor(int n, int k) { 9 | List list = new ArrayList<>(); 10 | for (int i = 1; i <= n; i++) { 11 | if (n % i == 0) { 12 | list.add(i); 13 | } 14 | } 15 | return list.size() >= k ? list.get(k - 1) : -1; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1502.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1502 { 6 | public static class Solution1 { 7 | public boolean canMakeArithmeticProgression(int[] arr) { 8 | Arrays.sort(arr); 9 | for (int i = 0; i < arr.length - 2; i++) { 10 | if (arr[i + 1] - arr[i] != arr[i + 2] - arr[i + 1]) { 11 | return false; 12 | } 13 | } 14 | return true; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1512.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1512 { 4 | public static class Solution1 { 5 | public int numIdenticalPairs(int[] nums) { 6 | int count = 0; 7 | for (int i = 0; i < nums.length; i++) { 8 | for (int j = i + 1; j < nums.length; j++) { 9 | if (nums[i] == nums[j]) { 10 | count++; 11 | } 12 | } 13 | } 14 | return count; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1523.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1523 { 4 | public static class Solution1 { 5 | public int countOdds(int low, int high) { 6 | if (low % 2 != 0 || high % 2 != 0) { 7 | return (high - low) / 2 + 1; 8 | } 9 | return (high - low) / 2; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1550.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1550 { 4 | public static class Solution1 { 5 | public boolean threeConsecutiveOdds(int[] arr) { 6 | for (int i = 0; i < arr.length - 2; i++) { 7 | if (arr[i] % 2 == 1 && arr[i + 1] % 2 == 1 && arr[i + 2] % 2 == 1) { 8 | return true; 9 | } 10 | } 11 | return false; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1551.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1551 { 4 | public static class Solution1 { 5 | public int minOperations(int n) { 6 | int min = 1; 7 | int max = 2 * (n - 1) + 1; 8 | int equalNumber = (max + min) / 2; 9 | int ops = 0; 10 | for (int i = 0; i < n / 2; i++) { 11 | ops += equalNumber - (2 * i + 1); 12 | } 13 | return ops; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1561.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1561 { 6 | public static class Solution1 { 7 | public int maxCoins(int[] piles) { 8 | Arrays.sort(piles); 9 | int j = 0; 10 | int coins = 0; 11 | for (int i = piles.length - 2; i > 0; i -= 2) { 12 | coins += piles[i]; 13 | if (++j == piles.length / 3) { 14 | return coins; 15 | } 16 | } 17 | return coins; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1619.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1619 { 6 | public static class Solution1 { 7 | public double trimMean(int[] arr) { 8 | Arrays.sort(arr); 9 | int n = arr.length; 10 | long sum = 0; 11 | for (int i = (int) Math.round(n * 0.05); i < (n - n * 0.05); i++) { 12 | sum += arr[i]; 13 | } 14 | return sum / (n - n * 0.1); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1668.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1668 { 4 | public static class Solution1 { 5 | public int maxRepeating(String sequence, String word) { 6 | StringBuilder sb = new StringBuilder(word); 7 | int times = 0; 8 | while (sequence.indexOf(sb.toString()) != -1) { 9 | times++; 10 | sb.append(word); 11 | } 12 | return times; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1688.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1688 { 4 | public static class Solution1 { 5 | public int numberOfMatches(int n) { 6 | int matches = 0; 7 | while (n > 1) { 8 | if (n % 2 == 0) { 9 | matches += n / 2; 10 | n /= 2; 11 | } else { 12 | matches += (n - 1) / 2; 13 | n = (n + 1) / 2; 14 | } 15 | } 16 | return matches; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1689.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1689 { 4 | public static class Solution1 { 5 | public int minPartitions(String n) { 6 | int max = 0; 7 | for (char c : n.toCharArray()) { 8 | int num = Integer.parseInt(c + ""); 9 | max = Math.max(max, num); 10 | } 11 | return max; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1720.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1720 { 4 | public static class Solution1 { 5 | public int[] decode(int[] encoded, int first) { 6 | int[] arr = new int[encoded.length + 1]; 7 | arr[0] = first; 8 | for (int i = 0; i < encoded.length; i++) { 9 | arr[i + 1] = encoded[i] ^ arr[i]; 10 | } 11 | return arr; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1725.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.TreeMap; 4 | 5 | public class _1725 { 6 | public static class Solution1 { 7 | public int countGoodRectangles(int[][] rectangles) { 8 | TreeMap map = new TreeMap<>(); 9 | for (int[] rec : rectangles) { 10 | int min = Math.min(rec[0], rec[1]); 11 | map.put(min, map.getOrDefault(min, 0) + 1); 12 | } 13 | return map.lastEntry().getValue(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1732.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1732 { 4 | public static class Solution1 { 5 | public int largestAltitude(int[] gain) { 6 | int max = 0; 7 | int[] altitudes = new int[gain.length + 1]; 8 | for (int i = 0; i < gain.length; i++) { 9 | altitudes[i + 1] = altitudes[i] + gain[i]; 10 | max = Math.max(max, altitudes[i + 1]); 11 | } 12 | return max; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1749.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1749 { 4 | public static class Solution1 { 5 | public int maxAbsoluteSum(int[] nums) { 6 | int min = 0; 7 | int max = 0; 8 | int s = 0; 9 | for (int num : nums) { 10 | s += num; 11 | min = Math.min(min, s); 12 | max = Math.max(max, s); 13 | } 14 | return max - min; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1753.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1753 { 6 | public static class Solution1 { 7 | public int maximumScore(int a, int b, int c) { 8 | int[] nums = new int[] {a, b, c}; 9 | Arrays.sort(nums); 10 | if (nums[0] + nums[1] < nums[2]) { 11 | return nums[0] + nums[1]; 12 | } else { 13 | return (nums[0] + nums[1] + nums[2]) / 2; 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1785.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1785 { 4 | public static class Solution1 { 5 | public int minElements(int[] nums, int limit, int goal) { 6 | long sum = 0; 7 | for (int num : nums) { 8 | sum += num; 9 | } 10 | long diff = Math.abs(goal - sum); 11 | return diff % limit == 0 ? (int) (diff / limit) : (int) ((diff / limit) + 1); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1816.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1816 { 4 | public static class Solution1 { 5 | public String truncateSentence(String s, int k) { 6 | String[] words = s.split(" "); 7 | StringBuilder sb = new StringBuilder(); 8 | for (int i = 0; i < k; i++) { 9 | sb.append(words[i]); 10 | sb.append(" "); 11 | } 12 | return sb.substring(0, sb.toString().length() - 1); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1822.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1822 { 4 | public static class Solution1 { 5 | public int arraySign(int[] nums) { 6 | int negativeCount = 0; 7 | for (int num : nums) { 8 | if (num == 0) { 9 | return 0; 10 | } else if (num < 0) { 11 | negativeCount++; 12 | } 13 | } 14 | return negativeCount % 2 == 0 ? 1 : -1; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1827.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1827 { 4 | public static class Solution1 { 5 | public int minOperations(int[] nums) { 6 | int minsOps = 0; 7 | for (int i = 1; i < nums.length; i++) { 8 | if (nums[i] <= nums[i - 1]) { 9 | minsOps += nums[i - 1] - nums[i] + 1; 10 | nums[i] = nums[i - 1] + 1; 11 | } 12 | } 13 | return minsOps; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1832.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class _1832 { 7 | public static class Solution1 { 8 | public boolean checkIfPangram(String sentence) { 9 | Set alphabet = new HashSet<>(); 10 | for (char c : sentence.toCharArray()) { 11 | alphabet.add(c); 12 | } 13 | return alphabet.size() == 26; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1837.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1837 { 4 | public static class Solution1 { 5 | public int sumBase(int n, int k) { 6 | String str = Integer.toString(Integer.parseInt(n + "", 10), k); 7 | int sum = 0; 8 | for (char c : str.toCharArray()) { 9 | sum += Character.getNumericValue(c); 10 | } 11 | return sum; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1860.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1860 { 4 | public static class Solution1 { 5 | public int[] memLeak(int memory1, int memory2) { 6 | int time = 1; 7 | while (memory1 >= time || memory2 >= time) { 8 | if (memory1 >= memory2) { 9 | memory1 -= time; 10 | } else { 11 | memory2 -= time; 12 | } 13 | time++; 14 | } 15 | return new int[] {time, memory1, memory2}; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1874.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1874 { 6 | public static class Solution1 { 7 | public int minProductSum(int[] nums1, int[] nums2) { 8 | Arrays.sort(nums1); 9 | Arrays.sort(nums2); 10 | int ans = 0; 11 | for (int i = 0, j = nums1.length - 1; i < nums1.length && j >= 0; i++, j--) { 12 | ans += nums1[i] * nums2[j]; 13 | } 14 | return ans; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1877.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1877 { 6 | public static class Solution1 { 7 | public int minPairSum(int[] nums) { 8 | Arrays.sort(nums); 9 | int maxSum = 0; 10 | for (int left = 0, right = nums.length - 1; left < right; left++, right--) { 11 | maxSum = Math.max(maxSum, nums[left] + nums[right]); 12 | } 13 | return maxSum; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1903.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1903 { 4 | public static class Solution1 { 5 | public String largestOddNumber(String num) { 6 | for (int i = num.length() - 1; i >= 0; i--) { 7 | if (Integer.parseInt("" + num.charAt(i)) % 2 == 1) { 8 | return num.substring(0, i + 1); 9 | } 10 | } 11 | return ""; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1913.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1913 { 6 | public static class Solution1 { 7 | public int maxProductDifference(int[] nums) { 8 | Arrays.sort(nums); 9 | int len = nums.length; 10 | return nums[len - 1] * nums[len - 2] - nums[0] * nums[1]; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1920.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1920 { 4 | public static class Solution1 { 5 | public int[] buildArray(int[] nums) { 6 | int[] ans = new int[nums.length]; 7 | for (int i = 0; i < nums.length; i++) { 8 | ans[i] = nums[nums[i]]; 9 | } 10 | return ans; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1929.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1929 { 4 | public static class Solution1 { 5 | public int[] getConcatenation(int[] nums) { 6 | int[] result = new int[nums.length * 2]; 7 | int i = 0; 8 | for (; i < nums.length; i++) { 9 | result[i] = nums[i]; 10 | } 11 | for (int j = 0; i < result.length && j < nums.length; i++, j++) { 12 | result[i] = nums[j]; 13 | } 14 | return result; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1952.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1952 { 4 | public static class Solution1 { 5 | public boolean isThree(int n) { 6 | int divisors = 0; 7 | for (int i = 1; i <= n; i++) { 8 | if (n % i == 0) { 9 | divisors++; 10 | } 11 | } 12 | return divisors == 3; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1961.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1961 { 4 | public static class Solution1 { 5 | public boolean isPrefixString(String s, String[] words) { 6 | StringBuilder sb = new StringBuilder(); 7 | for (String word : words) { 8 | sb.append(word); 9 | if (sb.toString().equals(s)) { 10 | return true; 11 | } 12 | } 13 | return false; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1967.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1967 { 6 | public static class Solution1 { 7 | public int numOfStrings(String[] patterns, String word) { 8 | return (int) Arrays.stream(patterns).filter(p -> word.indexOf(p) != -1).count(); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1974.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | public class _1974 { 4 | public static class Solution1 { 5 | public int minTimeToType(String word) { 6 | int min = 0; 7 | char curr = 'a'; 8 | for (int i = 0; i < word.length(); i++) { 9 | int diff = curr - word.charAt(i); 10 | curr = word.charAt(i); 11 | min += Math.min(diff + 26, Math.min(Math.abs(diff), 26 - diff)); 12 | min++; 13 | } 14 | return min; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1979.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1979 { 6 | public static class Solution1 { 7 | public int findGCD(int[] nums) { 8 | Arrays.sort(nums); 9 | return getGcd(nums[0], nums[nums.length - 1]); 10 | } 11 | 12 | int getGcd(int a, int b) { 13 | return b == 0 ? a : getGcd(b, a % b); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/secondthousand/_1984.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.secondthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _1984 { 6 | public static class Solution1 { 7 | public int minimumDifference(int[] nums, int k) { 8 | Arrays.sort(nums); 9 | int minDiff = nums[nums.length - 1]; 10 | for (int i = 0; i <= nums.length - k; i++) { 11 | minDiff = Math.min(minDiff, nums[i + k - 1] - nums[i]); 12 | } 13 | return minDiff; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2006.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2006 { 4 | public static class Solution1 { 5 | public int countKDifference(int[] nums, int k) { 6 | int pairs = 0; 7 | for (int i = 0; i < nums.length - 1; i++) { 8 | for (int j = i + 1; j < nums.length; j++) { 9 | if (Math.abs(nums[i] - nums[j]) == k) { 10 | pairs++; 11 | } 12 | } 13 | } 14 | return pairs; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2011.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2011 { 4 | public static class Solution1 { 5 | public int finalValueAfterOperations(String[] operations) { 6 | int val = 0; 7 | for (String op : operations) { 8 | if (op.equals("++X") || op.equals("X++")) { 9 | val++; 10 | } else { 11 | val--; 12 | } 13 | } 14 | return val; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2016.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2016 { 4 | public static class Solution1 { 5 | public int maximumDifference(int[] nums) { 6 | int maxDiff = -1; 7 | for (int i = 0; i < nums.length - 1; i++) { 8 | for (int j = i + 1; j < nums.length; j++) { 9 | if (nums[j] >= nums[i]) { 10 | maxDiff = Math.max(nums[j] - nums[i], maxDiff); 11 | } 12 | } 13 | } 14 | return maxDiff; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2037.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _2037 { 6 | public static class Solution1 { 7 | public int minMovesToSeat(int[] seats, int[] students) { 8 | int ans = 0; 9 | Arrays.sort(seats); 10 | Arrays.sort(students); 11 | for (int i = 0; i < seats.length; i++) { 12 | ans += Math.abs(seats[i] - students[i]); 13 | } 14 | return ans; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2057.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2057 { 4 | public static class Solution1 { 5 | public int smallestEqual(int[] nums) { 6 | for (int i = 0; i < nums.length; i++) { 7 | if (i % 10 == nums[i]) { 8 | return i; 9 | } 10 | } 11 | return -1; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2109.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2109 { 4 | public static class Solution1 { 5 | public String addSpaces(String s, int[] spaces) { 6 | StringBuilder sb = new StringBuilder(); 7 | for (int i = 0, j = 0; i < s.length(); i++) { 8 | if (j < spaces.length && i == spaces[j]) { 9 | sb.append(" "); 10 | j++; 11 | } 12 | sb.append(s.charAt(i)); 13 | } 14 | return sb.toString(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2114.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2114 { 4 | public static class Solution1 { 5 | public int mostWordsFound(String[] sentences) { 6 | int max = 0; 7 | for (String sentence : sentences) { 8 | max = Math.max(max, sentence.split("\\ ").length); 9 | } 10 | return max; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2119.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2119 { 4 | public static class Solution1 { 5 | public boolean isSameAfterReversals(int num) { 6 | if (num == 0) { 7 | return true; 8 | } 9 | return num % 10 != 0; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2124.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2124 { 4 | public static class Solution1 { 5 | public boolean checkString(String s) { 6 | int aIndex = s.lastIndexOf('a'); 7 | if (aIndex < 0) { 8 | return true; 9 | } 10 | for (int i = 0; i < aIndex; i++) { 11 | if (s.charAt(i) == 'b') { 12 | return false; 13 | } 14 | } 15 | return true; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2144.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _2144 { 6 | public static class Solution1 { 7 | public int minimumCost(int[] cost) { 8 | Arrays.sort(cost); 9 | int ans = 0; 10 | for (int i = cost.length - 1; i >= 0; i--) { 11 | ans += cost[i]; 12 | i--; 13 | if (i >= 0) { 14 | ans += cost[i]; 15 | } 16 | i--; 17 | } 18 | return ans; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2154.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class _2154 { 7 | public static class Solution1 { 8 | public int findFinalValue(int[] nums, int original) { 9 | Set set = new HashSet<>(); 10 | for (int num : nums) { 11 | set.add(num); 12 | } 13 | while (set.contains(original)) { 14 | original *= 2; 15 | } 16 | return original; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2177.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2177 { 4 | public static class Solution1 { 5 | public long[] sumOfThree(long num) { 6 | long remainder = num % 3; 7 | long ave = num / 3; 8 | if (remainder == 0) { 9 | return new long[] {ave - 1, ave, ave + 1}; 10 | } else { 11 | return new long[] {}; 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2185.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2185 { 4 | public static class Solution1 { 5 | public int prefixCount(String[] words, String pref) { 6 | int count = 0; 7 | for (String word : words) { 8 | if (word.startsWith(pref)) { 9 | count++; 10 | } 11 | } 12 | return count; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2235.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2235 { 4 | public static class Solution1 { 5 | public int sum(int num1, int num2) { 6 | return num1 + num2; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2236.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import com.fishercoder.common.classes.TreeNode; 4 | 5 | public class _2236 { 6 | public static class Solution1 { 7 | public boolean checkTree(TreeNode root) { 8 | return root.val == root.left.val + root.right.val; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2255.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2255 { 4 | public static class Solution1 { 5 | public int countPrefixes(String[] words, String s) { 6 | int count = 0; 7 | for (String word : words) { 8 | if (s.startsWith(word)) { 9 | count++; 10 | } 11 | } 12 | return count; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2278.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2278 { 4 | public static class Solution1 { 5 | public int percentageLetter(String s, char letter) { 6 | int count = 0; 7 | for (char c : s.toCharArray()) { 8 | if (c == letter) { 9 | count++; 10 | } 11 | } 12 | return (int) Math.floor((count * 100.0 / s.length())); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2351.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class _2351 { 7 | public static class Solution1 { 8 | public char repeatedCharacter(String s) { 9 | Set set = new HashSet<>(); 10 | for (char c : s.toCharArray()) { 11 | if (!set.add(c)) { 12 | return c; 13 | } 14 | } 15 | return ' '; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2395.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | public class _2395 { 7 | public static class Solution1 { 8 | public boolean findSubarrays(int[] nums) { 9 | Set sums = new HashSet<>(); 10 | for (int i = 0; i < nums.length - 1; i++) { 11 | int sum = nums[i] + nums[i + 1]; 12 | if (!sums.add(sum)) { 13 | return true; 14 | } 15 | } 16 | return false; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2413.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2413 { 4 | public static class Solution1 { 5 | public int smallestEvenMultiple(int n) { 6 | return n % 2 == 0 ? n : n * 2; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2427.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2427 { 4 | public static class Solution1 { 5 | public int commonFactors(int a, int b) { 6 | int ans = 1; 7 | int num = 2; 8 | while (num <= a && num <= b) { 9 | if (a % num == 0 && b % num == 0) { 10 | ans++; 11 | } 12 | num++; 13 | } 14 | return ans; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2433.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2433 { 4 | public static class Solution1 { 5 | public int[] findArray(int[] pref) { 6 | int[] arr = new int[pref.length]; 7 | arr[0] = pref[0]; 8 | int arrResult = arr[0]; 9 | for (int i = 1; i < pref.length; i++) { 10 | arr[i] = arrResult ^ pref[i]; 11 | arrResult ^= arr[i]; 12 | } 13 | return arr; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2455.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2455 { 4 | public static class Solution1 { 5 | public int averageValue(int[] nums) { 6 | Long sum = 0L; 7 | int count = 0; 8 | for (int num : nums) { 9 | if (num % 3 == 0 && num % 2 == 0) { 10 | sum += num; 11 | count++; 12 | } 13 | } 14 | return count != 0 ? (int) (sum / count) : 0; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2465.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.Arrays; 4 | import java.util.HashSet; 5 | import java.util.Set; 6 | 7 | public class _2465 { 8 | public static class Solution1 { 9 | public int distinctAverages(int[] nums) { 10 | Arrays.sort(nums); 11 | Set averageSet = new HashSet<>(); 12 | for (int i = 0, j = nums.length - 1; i < j; i++, j--) { 13 | averageSet.add((nums[i] + nums[j]) / 2.0); 14 | } 15 | return averageSet.size(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2469.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2469 { 4 | public static class Solution1 { 5 | public double[] convertTemperature(double celsius) { 6 | return new double[] {celsius + 273.15, celsius * 1.80 + 32.00}; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2481.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2481 { 4 | public static class Solution1 { 5 | public int numberOfCuts(int n) { 6 | if (n == 1) { 7 | return 0; 8 | } 9 | if (n % 2 == 0) { 10 | return n / 2; 11 | } 12 | return n; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2496.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2496 { 4 | public static class Solution1 { 5 | public int maximumValue(String[] strs) { 6 | int max = 0; 7 | for (String str : strs) { 8 | try { 9 | int num = Integer.parseInt(str); 10 | max = Math.max(max, num); 11 | } catch (Exception e) { 12 | max = Math.max(max, str.length()); 13 | } 14 | } 15 | return max; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2520.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2520 { 4 | public static class Solution1 { 5 | public int countDigits(int num) { 6 | int original = num; 7 | int sum = 0; 8 | while (num != 0) { 9 | int digit = num % 10; 10 | num /= 10; 11 | if (original % digit == 0) { 12 | sum++; 13 | } 14 | } 15 | return sum; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2529.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2529 { 4 | public static class Solution1 { 5 | public int maximumCount(int[] nums) { 6 | int pos = 0; 7 | int neg = 0; 8 | for (int num : nums) { 9 | if (num > 0) { 10 | pos++; 11 | } else if (num < 0) { 12 | neg++; 13 | } 14 | } 15 | return Math.max(pos, neg); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2535.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2535 { 4 | public static class Solution1 { 5 | public int differenceOfSum(int[] nums) { 6 | long elementSum = 0L; 7 | long digitSum = 0L; 8 | for (int num : nums) { 9 | elementSum += num; 10 | while (num != 0) { 11 | digitSum += num % 10; 12 | num /= 10; 13 | } 14 | } 15 | return (int) Math.abs(elementSum - digitSum); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2651.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2651 { 4 | public static class Solution1 { 5 | public int findDelayedArrivalTime(int arrivalTime, int delayedTime) { 6 | return (arrivalTime + delayedTime) % 24; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2652.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2652 { 4 | public static class Solution1 { 5 | public int sumOfMultiples(int n) { 6 | int sum = 0; 7 | for (int i = 1; i <= n; i++) { 8 | if (i % 3 == 0 || i % 5 == 0 || i % 7 == 0) { 9 | sum += i; 10 | } 11 | } 12 | return sum; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2656.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2656 { 4 | public static class Solution1 { 5 | public int maximizeSum(int[] nums, int k) { 6 | int max = 0; 7 | for (int i = 0; i < nums.length; i++) { 8 | max = Math.max(max, nums[i]); 9 | } 10 | int sum = 0; 11 | while (k-- > 0) { 12 | sum += max; 13 | max++; 14 | } 15 | return sum; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2678.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2678 { 4 | public static class Solution1 { 5 | public int countSeniors(String[] details) { 6 | int seniors = 0; 7 | for (String detail : details) { 8 | if (Integer.parseInt(detail.substring(11, 13)) > 60) { 9 | seniors++; 10 | } 11 | } 12 | return seniors; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2706.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _2706 { 6 | public static class Solution1 { 7 | public int buyChoco(int[] prices, int money) { 8 | Arrays.sort(prices); 9 | if (prices[0] + prices[1] > money) { 10 | return money; 11 | } else { 12 | return money - prices[0] - prices[1]; 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2769.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2769 { 4 | public static class Solution1 { 5 | public int theMaximumAchievableX(int num, int t) { 6 | return num + t * 2; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2778.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2778 { 4 | public static class Solution1 { 5 | public int sumOfSquares(int[] nums) { 6 | int sum = 0; 7 | int len = nums.length; 8 | for (int i = 0; i < len; i++) { 9 | if (len % (i + 1) == 0) { 10 | sum += nums[i] * nums[i]; 11 | } 12 | } 13 | return sum; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2798.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.Arrays; 4 | 5 | public class _2798 { 6 | public static class Solution1 { 7 | public int numberOfEmployeesWhoMetTarget(int[] hours, int target) { 8 | return (int) Arrays.stream(hours).filter(hour -> hour >= target).count(); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2810.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2810 { 4 | public static class Solution1 { 5 | public String finalString(String s) { 6 | StringBuilder sb = new StringBuilder(); 7 | for (int i = 0; i < s.length(); i++) { 8 | if (s.charAt(i) == 'i') { 9 | sb.reverse(); 10 | } else { 11 | sb.append(s.charAt(i)); 12 | } 13 | } 14 | return sb.toString(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2828.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.List; 4 | 5 | public class _2828 { 6 | public static class Solution1 { 7 | public boolean isAcronym(List words, String s) { 8 | if (words.size() != s.length()) { 9 | return false; 10 | } 11 | int i = 0; 12 | for (String word : words) { 13 | if (word.charAt(0) != s.charAt(i++)) { 14 | return false; 15 | } 16 | } 17 | return true; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2848.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.HashSet; 4 | import java.util.List; 5 | import java.util.Set; 6 | 7 | public class _2848 { 8 | public static class Solution1 { 9 | public int numberOfPoints(List> nums) { 10 | Set set = new HashSet<>(); 11 | for (List num : nums) { 12 | for (int i = num.get(0); i <= num.get(1); i++) { 13 | set.add(i); 14 | } 15 | } 16 | return set.size(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2894.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | public class _2894 { 4 | public static class Solution1 { 5 | public int differenceOfSums(int n, int m) { 6 | int sum1 = 0; 7 | int sum2 = 0; 8 | for (int num = 1; num <= n; num++) { 9 | if (num % m != 0) { 10 | sum1 += num; 11 | } else { 12 | sum2 += num; 13 | } 14 | } 15 | return sum1 - sum2; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2942.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class _2942 { 7 | public static class Solution1 { 8 | public List findWordsContaining(String[] words, char x) { 9 | List result = new ArrayList<>(); 10 | for (int i = 0; i < words.length; i++) { 11 | if (words[i].indexOf(x) != -1) { 12 | result.add(i); 13 | } 14 | } 15 | return result; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/fishercoder/solutions/thirdthousand/_2951.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.solutions.thirdthousand; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class _2951 { 7 | public static class Solution1 { 8 | public List findPeaks(int[] mountain) { 9 | List ans = new ArrayList<>(); 10 | for (int i = 1; i < mountain.length - 1; i++) { 11 | if (mountain[i] > mountain[i - 1] && mountain[i] > mountain[i + 1]) { 12 | ans.add(i); 13 | } 14 | } 15 | return ans; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_115Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._115; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _115Test { 10 | private _115.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _115.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(3, solution1.numDistinct("rabbbit", "rabbit")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_132Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._132; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _132Test { 10 | private _132.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _132.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(1, solution1.minCut("aab")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_150Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._150; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _150Test { 10 | private _150.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _150.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(9, solution1.evalRPN(new String[] {"2", "1", "+", "3", "*"})); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_161Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._161; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _161Test { 10 | private _161.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _161.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(true, solution1.isOneEditDistance("a", "ac")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_168Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._168; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _168Test { 10 | private _168.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _168.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("APSM", solution1.convertToTitle(28899)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_171Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._171; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _171Test { 10 | private _171.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _171.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(28, solution1.titleToNumber("AB")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_202Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._202; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _202Test { 10 | private _202.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _202.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(true, solution1.isHappy(7)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_291Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._291; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _291Test { 10 | private _291.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _291.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(true, solution1.wordPatternMatch("abab", "redblueredblue")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_294Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._294; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _294Test { 10 | private _294.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _294.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(true, solution1.canWin("++++")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_384Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import com.fishercoder.common.utils.CommonUtils; 4 | import com.fishercoder.solutions.firstthousand._384; 5 | import org.junit.jupiter.api.Test; 6 | 7 | public class _384Test { 8 | private _384.Solution2 solution2; 9 | 10 | @Test 11 | public void test1() { 12 | solution2 = new _384.Solution2(new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); 13 | CommonUtils.printArray(solution2.shuffle()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_38Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._38; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _38Test { 10 | private _38.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _38.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("21", solution1.countAndSay(3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_402Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._402; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _402Test { 10 | private _402.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _402.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("1219", solution1.removeKdigits("1432219", 3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_441Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._441; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _441Test { 10 | private _441.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _441.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(2, solution1.arrangeCoins(3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_453Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._453; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _453Test { 10 | private _453.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _453.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(3, solution1.minMoves(new int[] {1, 2, 3})); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_456Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._456; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _456Test { 10 | private _456.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _456.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(true, solution1.find132pattern(new int[] {-1, 3, 2, 0})); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_467Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._467; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _467Test { 10 | private _467.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _467.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(1, solution1.findSubstringInWraproundString("a")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_478Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import com.fishercoder.common.utils.CommonUtils; 4 | import com.fishercoder.solutions.firstthousand._478; 5 | import org.junit.jupiter.api.Test; 6 | 7 | public class _478Test { 8 | private _478.Solution1 solution1; 9 | 10 | @Test 11 | public void test1() { 12 | solution1 = new _478.Solution1(10.0, 5.0, -7.5); 13 | CommonUtils.printArray(solution1.randPoint()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_479Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._479; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _479Test { 10 | private _479.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _479.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(123, solution1.largestPalindrome(3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_516Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._516; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _516Test { 10 | private _516.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _516.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(4, solution1.longestPalindromeSubseq("bbbab")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_58Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._58; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _58Test { 10 | private _58.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _58.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(5, solution1.lengthOfLastWord("Hello World")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_60Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._60; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _60Test { 10 | private _60.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _60.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("231", solution1.getPermutation(3, 4)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_62Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._62; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _62Test { 10 | private _62.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _62.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(1, solution1.uniquePaths(1, 2)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_67Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._67; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _67Test { 10 | private _67.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _67.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("100", solution1.addBinary("11", "1")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_681Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._681; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _681Test { 10 | private _681.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _681.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("19:39", solution1.nextClosestTime("19:34")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_6Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._6; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _6Test { 10 | private _6.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _6.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("PAHNAPLSIIGYIR", solution1.convert("PAYPALISHIRING", 3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_709Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._709; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _709Test { 10 | private _709.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _709.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("hello", solution1.toLowerCase("Hello")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_738Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._738; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _738Test { 10 | private _738.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _738.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(9, solution1.monotoneIncreasingDigits(10)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_762Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._762; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _762Test { 10 | private _762.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _762.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(4, solution1.countPrimeSetBits(6, 10)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_771Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._771; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _771Test { 10 | private _771.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _771.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(3, solution1.numJewelsInStones("aA", "aAAbbbb")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_775Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._775; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _775Test { 10 | private _775.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _775.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(true, solution1.isIdealPermutation(new int[] {0, 1})); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_791Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._791; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _791Test { 10 | private _791.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _791.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("cbad", solution1.customSortString("cba", "abcd")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_800Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._800; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _800Test { 10 | private _800.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setUp() { 14 | solution1 = new _800.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("#11ee66", solution1.similarRGB("#09f166")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_80Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._80; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _80Test { 10 | private _80.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _80.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(5, (solution1.removeDuplicates(new int[] {1, 1, 1, 2, 2, 3}))); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_84Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._84; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _84Test { 10 | private _84.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _84.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(10, (solution1.largestRectangleArea(new int[] {2, 1, 5, 6, 2, 3}))); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_877Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._877; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _877Test { 10 | private _877.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _877.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(true, solution1.stoneGame(new int[] {5, 3, 4, 5})); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_933Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._933; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _933Test { 10 | private _933.Solution1.RecentCounter solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _933.Solution1.RecentCounter(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(1, solution1.ping(1)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_95Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import com.fishercoder.common.utils.TreeUtils; 4 | import com.fishercoder.solutions.firstthousand._95; 5 | import org.junit.jupiter.api.BeforeEach; 6 | import org.junit.jupiter.api.Test; 7 | 8 | public class _95Test { 9 | private _95.Solution1 solution1; 10 | 11 | @BeforeEach 12 | public void setup() { 13 | solution1 = new _95.Solution1(); 14 | } 15 | 16 | @Test 17 | public void test1() { 18 | solution1.generateTrees(3).forEach(TreeUtils::printBinaryTree); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_96Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._96; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _96Test { 10 | private _96.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _96.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(5, solution1.numTrees(3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/firstthousand/_974Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.firstthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.firstthousand._974; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _974Test { 10 | 11 | private _974.Solution1 test; 12 | 13 | @BeforeEach 14 | public void setup() { 15 | test = new _974.Solution1(); 16 | } 17 | 18 | @Test 19 | public void test1() { 20 | assertEquals(7, test.subarraysDivByK(new int[] {4, 5, 0, -2, -3, 1}, 5)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/fourththousand/_3016Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.fourththousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.fourththousand._3016; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _3016Test { 10 | private _3016.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _3016.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(24, solution1.minimumPushes("aabbccddeeffgghhiiiiii")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/fourththousand/_3083Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.fourththousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertTrue; 4 | 5 | import com.fishercoder.solutions.fourththousand._3083; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _3083Test { 10 | private _3083.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _3083.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertTrue(solution1.isSubstringPresent("leetcode")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/fourththousand/_3090Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.fourththousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.fourththousand._3090; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _3090Test { 10 | private _3090.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _3090.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(4, solution1.maximumLengthSubstring("bcbbbcba")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/fourththousand/_3234Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.fourththousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.fourththousand._3234; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _3234Test { 10 | private _3234.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _3234.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(5, solution1.numberOfSubstrings("00011")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/fourththousand/_3270Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.fourththousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.fourththousand._3270; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _3270Test { 10 | private _3270.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _3270.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(0, solution1.generateKey(1, 10, 1000)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/fourththousand/_3345Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.fourththousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.fourththousand._3345; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _3345Test { 10 | private _3345.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _3345.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(10, solution1.smallestNumber(10, 2)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1047Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1047; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1047Test { 10 | private _1047.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1047.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("ca", solution1.removeDuplicates("abbaca")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1281Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1281; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1281Test { 10 | private _1281.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1281.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(15, solution1.subtractProductAndSum(234)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1304Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import com.fishercoder.common.utils.CommonUtils; 4 | import com.fishercoder.solutions.secondthousand._1304; 5 | import org.junit.jupiter.api.BeforeEach; 6 | import org.junit.jupiter.api.Test; 7 | 8 | public class _1304Test { 9 | private _1304.Solution1 solution1; 10 | 11 | @BeforeEach 12 | public void setup() { 13 | solution1 = new _1304.Solution1(); 14 | } 15 | 16 | @Test 17 | public void test1() { 18 | CommonUtils.printArray(solution1.sumZero(5)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1323Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1323; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1323Test { 10 | private _1323.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1323.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(9969, solution1.maximum69Number(9669)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1415Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1415; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1415Test { 10 | 11 | private _1415.Solution1 solution1; 12 | 13 | @BeforeEach 14 | public void setup() { 15 | solution1 = new _1415.Solution1(); 16 | } 17 | 18 | @Test 19 | public void test1() { 20 | assertEquals("cab", solution1.getHappyString(3, 9)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1432Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1432; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1432Test { 10 | private _1432.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1432.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(888, solution1.maxDiff(555)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1446Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1446; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1446Test { 10 | private _1446.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1446.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(2, solution1.maxPower("leetcode")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1456Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1456; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1456Test { 10 | private _1456.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1456.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(3, solution1.maxVowels("abciiidef", 3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1461Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1461; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1461Test { 10 | private _1461.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1461.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(true, solution1.hasAllCodes("00110110", 2)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1486Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1486; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1486Test { 10 | private _1486.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1486.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(8, solution1.xorOperation(5, 0)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1492Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1492; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1492Test { 10 | private _1492.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1492.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(3, solution1.kthFactor(12, 3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1496Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1496; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1496Test { 10 | private _1496.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1496.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(false, solution1.isPathCrossing("NES")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1523Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1523; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1523Test { 10 | private _1523.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1523.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(3, solution1.countOdds(3, 7)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1551Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1551; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1551Test { 10 | private _1551.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1551.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(2, solution1.minOperations(3)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1576Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1576; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1576Test { 10 | private _1576.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1576.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("azs", solution1.modifyString("?zs")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1688Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1688; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1688Test { 10 | private _1688.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1688.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(6, solution1.numberOfMatches(7)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1758Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1758; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1758Test { 10 | private _1758.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1758.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(1, solution1.minOperations("0100")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1781Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.secondthousand._1781; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _1781Test { 10 | private _1781.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _1781.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(5, solution1.beautySum("aabcb")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/secondthousand/_1968Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.secondthousand; 2 | 3 | import com.fishercoder.common.utils.CommonUtils; 4 | import com.fishercoder.solutions.secondthousand._1968; 5 | import org.junit.jupiter.api.BeforeEach; 6 | import org.junit.jupiter.api.Test; 7 | 8 | public class _1968Test { 9 | private _1968.Solution1 solution1; 10 | 11 | @BeforeEach 12 | public void setup() { 13 | solution1 = new _1968.Solution1(); 14 | } 15 | 16 | @Test 17 | public void test1() { 18 | CommonUtils.printArray(solution1.rearrangeArray(new int[] {1, 2, 3, 4, 5})); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2007Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import com.fishercoder.common.utils.CommonUtils; 4 | import com.fishercoder.solutions.thirdthousand._2007; 5 | import org.junit.jupiter.api.BeforeEach; 6 | import org.junit.jupiter.api.Test; 7 | 8 | public class _2007Test { 9 | private _2007.Solution1 solution1; 10 | 11 | @BeforeEach 12 | public void setup() { 13 | solution1 = new _2007.Solution1(); 14 | } 15 | 16 | @Test 17 | public void test1() { 18 | CommonUtils.printArray(solution1.findOriginalArray(new int[] {1, 3, 4, 2, 6, 8})); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2220Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2220; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2220Test { 10 | private _2220.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2220.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(3, solution1.minBitFlips(10, 7)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2485Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2485; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2485Test { 10 | private _2485.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2485.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(1, solution1.pivotInteger(1)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2578Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2578; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2578Test { 10 | private _2578.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2578.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(59, solution1.splitNum(4325)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2600Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2600; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2600Test { 10 | private _2600.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2600.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(3, solution1.kItemsWithMaximumSum(4, 2, 3, 7)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2696Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2696; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2696Test { 10 | private _2696.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2696.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(2, solution1.minLength("ABFCACDB")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2710Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2710; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2710Test { 10 | private _2710.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2710.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals("512301", solution1.removeTrailingZeros("51230100")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2716Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2716; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2716Test { 10 | private _2716.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2716.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(2, solution1.minimizedStringLength("ipi")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2729Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertTrue; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2729; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2729Test { 10 | private _2729.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2729.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertTrue(solution1.isFascinating(192)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2739Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2739; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2739Test { 10 | private _2739.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2739.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertEquals(20, solution1.distanceTraveled(2, 1)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/fishercoder/thirdthousand/_2839Test.java: -------------------------------------------------------------------------------- 1 | package com.fishercoder.thirdthousand; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertTrue; 4 | 5 | import com.fishercoder.solutions.thirdthousand._2839; 6 | import org.junit.jupiter.api.BeforeEach; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class _2839Test { 10 | private _2839.Solution1 solution1; 11 | 12 | @BeforeEach 13 | public void setup() { 14 | solution1 = new _2839.Solution1(); 15 | } 16 | 17 | @Test 18 | public void test1() { 19 | assertTrue(solution1.canBeEqual("bnxw", "bwxn")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/fishercoder.properties: -------------------------------------------------------------------------------- 1 | size = 100M 2 | #this didn't work out as expected to make _532.test4 to compile per this post: 3 | #https://stackoverflow.com/questions/2407912/code-too-large-compilation-error-in-java --------------------------------------------------------------------------------