Skip to content

Solutions to LeetCode problems; updated daily. Subscribe to my YouTube channel for more.

License

Notifications You must be signed in to change notification settings

fishercoder1534/Leetcode

Repository files navigation

If you like this project, please leave me a star. ★

"For coding interview preparation, LeetCode is one of the best online resource providing a rich library of more than 300 real coding interview questions for you to practice from using one of the 7 supported languages - C, C++, Java, Python, C#, JavaScript, Ruby."

Algorithms

For problems 1 to 999

For problems 1000 to 1999

For problems 2000 to 2999

For problems 3000 to 3999

Database

# Title Solutions Video Difficulty Tag
1757 Recyclable and Low Fat Products Solution Easy
1729 Find Followers Count Solution Easy
1709 Biggest Window Between Visits Solution Medium
1693 Daily Leads and Partners Solution Easy
1683 Invalid Tweets Solution Easy
1677 Product's Worth Over Invoices Solution Easy
1667 Fix Names in a Table Solution Easy
1661 Average Time of Process per Machine Solution Easy
1633 Percentage of Users Attended a Contest Solution Easy
1623 All Valid Triplets That Can Represent a Country Solution Easy
1607 Sellers With No Sales Solution Easy
1596 The Most Frequently Ordered Products for Each Customer Solution Medium
1571 Warehouse Manager Solution Easy
1587 Bank Account Summary II Solution Easy
1581 Customer Who Visited but Did Not Make Any Transactions Solution Easy
1565 Unique Orders and Customers Per Month Solution Easy
1543 Fix Product Name Format Solution Easy
1527 Patients With a Condition Solution Easy
1517 Find Users With Valid E-Mails Solution Easy
1511 Customer Order Frequency Solution Easy
1495 Friendly Movies Streamed Last Month Solution Easy
1435 Create a Session Bar Chart Solution Easy
1484 Group Sold Products By The Date Solution Easy
1445 Apples & Oranges Solution Medium
1407 Top Travellers Solution Easy
1393 Capital Gain/Loss Solution Easy
1384 Total Sales Amount by Year Solution Hard
1378 Replace Employee ID With The Unique Identifier Solution Easy
1371 The Number of Employees Which Report to Each Employee Solution Easy
1369 Get the Second Most Recent Activity Solution Hard
1364 Number of Trusted Contacts of a Customer Solution Medium
1355 Activity Participants Solution Medium
1350 Students With Invalid Departments Solution Easy
1341 Movie Rating Solution Medium
1327 List the Products Ordered in a Period Solution Easy
1322 Ads Performance Solution Easy
1308 Running Total for Different Genders Solution Medium
1303 Find the Team Size Solution Easy
1294 Weather Type in Each Country Solution Easy
1285 Find the Start and End Number of Continuous Ranges Solution Medium
1280 Students and Examinations Solution 📺 Easy
1270 All People Report to the Given Manager Solution Medium
1251 Average Selling Price Solution Easy
1241 Number of Comments per Post Solution Easy
1211 Queries Quality and Percentage Solution Easy
1179 Reformat Department Table Solution Easy
1173 Immediate Food Delivery I Solution Easy
1148 Article Views I Solution Easy
1142 User Activity for the Past 30 Days II Solution Easy
1141 User Activity for the Past 30 Days I Solution Easy
1113 Reported Posts Solution Easy
1084 Sales Analysis III Solution Easy
1083 Sales Analysis II Solution Easy
1082 Sales Analysis I Solution Easy
1076 Project Employees II Solution Easy
1075 Project Employees I Solution Easy
1069 Product Sales Analysis II Solution Easy
1068 Product Sales Analysis I Solution Easy
1050 Actors and Directors Who Cooperated At Least Three Times Solution Easy
627 Swap Salary Solution Easy
626 Exchange Seats Solution Medium
620 Not Boring Movies Solution Easy
619 Biggest Single Number Solution Easy
618 Students Report By Geography Solution Hard Session Variables
615 Average Salary: Departments VS Company Solution Hard
614 Second Degree Follower Solution Medium Inner Join
613 Shortest Distance in a Line Solution Easy
612 Shortest Distance in a Plane Solution Medium
610 Triangle Judgement Solution Easy
608 Tree Node Solution Medium Union
607 Sales Person Solution Easy
603 Consecutive Available Seats Solution Easy
602 Friend Requests II: Who Has the Most Friends Solution Medium
601 Human Traffic of Stadium Solution Hard
597 Friend Requests I: Overall Acceptance Rate Solution Easy
596 Classes More Than 5 Students Solution Easy
595 Big Countries Solution Easy
586 Customer Placing the Largest Number of Orders Solution Easy
585 Investments in 2016 Solution Medium
584 Find Customer Referee Solution Easy
580 Count Student Number in Departments Solution Medium Left Join
578 Get Highest Answer Rate Question Solution Medium
577 Employee Bonus Solution Easy
574 Winning Candidate Solution Medium
571 Find Median Given Frequency of Numbers Solution Hard
570 Managers with at Least 5 Direct Reports Solution Medium
569 Median Employee Salary Solution Hard
534 Game Play Analysis III Solution Easy
512 Game Play Analysis II Solution Easy
511 Game Play Analysis I Solution Easy
262 Trips and Users Solution Hard Inner Join
197 Rising Temperature Solution Easy
196 Delete Duplicate Emails Solution Easy
185 Department Top Three Salaries Solution Hard
184 Department Highest Salary Solution Medium
183 Customers Who Never Order Solution Easy
182 Duplicate Emails Solution Easy
181 Employees Earning More Than Their Managers Solution Easy
180 Consecutive Numbers Solution Medium
178 Rank Scores Solution Medium
177 Nth Highest Salary Solution Medium
176 Second Highest Salary Solution Easy
175 Combine Two Tables Solution Easy

Shell

# Title Solutions Video Difficulty Tag
195 Tenth Line Solution Easy
194 Transpose File Solution Medium
193 Valid Phone Numbers Solution Easy
192 Word Frequency Solution Medium

Contributing

Your ideas/fixes/algorithms are more than welcome!

  1. Please make sure your PR builds after submitting! Check out here: https://travis-ci.org/github/fishercoder1534/Leetcode/pull_requests and look for your PR build.
  2. Fork this repo
  3. Clone your forked repo (git clone https://github.com/YOUR_GITHUB_USERNAME/Leetcode.git) onto your local machine
  4. cd into your cloned directory, create your feature branch (git checkout -b my-awesome-fix)
  5. git add your desired changes to this repo
  6. Commit your changes (git commit -m 'Added some awesome features/fixes')
  7. Push to the branch (git push origin my-awesome-feature)
  8. Open your forked repo on Github website, create a new Pull Request to this repo!

Best way to open this project

  1. Install IntelliJ on your machine, either CE or UE.
  2. git clone this repo to your local disk
  3. import this project as a new project (does need to be imported as a gradle project)
  4. If you run into "Could not determine Java version using executable ..." error, use local gradle distribution: "/usr/local/Cellar/gradle/4.8.1/libexec/" instead of the default one. More details, see this question on Stackoverflow.