Coder Social home page Coder Social logo

leetcode-java's Introduction

LeetCode Java Solutions


  

Hi 👋, I'm Chee Hwa and welcome to LeetCode Solutions in Java.

As I'm new to LeetCode and progamming in general, I'm practicing everyday and hope to share my solutions and learnings with you.

  • Exclusively on Java
  • Beginner problems
  • Daily Challenge if within my ability

Topics

The problem sets and solutions are grouped into Topics as stated in LeetCode.




Array

# Problem Solution Difficulty Topics Note
1 Two Sum Java $\text{\color{TealBlue}Easy}$ Array, Hash Table
334 Increasing Triplet Subsequence Java $\text{\color{Dandelion}Medium}$ Array, Greedy
393 UTF-8 Validation Java without, or with Bit Manipulation $\text{\color{Dandelion}Medium}$ Array, Bit Manipulation
485 Maximum Consecutive Ones Java $\text{\color{TealBlue}Easy}$ Array
609 Find Duplicate File in System Java $\text{\color{Dandelion}Medium}$ Array, Hash Table, String
812 Largest Triangle Area Java $\text{\color{TealBlue}Easy}$ Array, Geometry, Math
929 Unique Email Addresses Java $\text{\color{TealBlue}Easy}$ Array, Hash Table, String
948 Bag of Tokens Java $\text{\color{Dandelion}Medium}$ Array, Greedy, Sorting, Two Pointers
976 Largest Perimeter Triangle Java $\text{\color{TealBlue}Easy}$ Array, Greedy, Math, Sorting
985 Sum of Even Numbers After Queries Java $\text{\color{Dandelion}Medium}$ Array, Simulation
1337 The K Weakest Rows in a Matrix Java with Heap (Priority Queue) or Sorting $\text{\color{TealBlue}Easy}$ Array, Binary Search, Heap (Priority Queue), Matrix, Sorting
1480 Running Sum of 1D Array Java $\text{\color{TealBlue}Easy}$ Array, Prefix Sum
1578 Minimum Time to Make Rope Colorful Java $\text{\color{Dandelion}Medium}$ Array, Dynamic Programming, Greedy, String
1672 Richest Customer Wealth Java $\text{\color{TealBlue}Easy}$ Array, Matrix
1679 Max Number of K-Sum Pairs Java with Hash Table or Sorting & Two Pointers $\text{\color{Dandelion}Medium}$ Array, Hash Table, Sorting, Two Pointers
1711 Count Good Meals Java $\text{\color{Dandelion}Medium}$ Array, Hash Table
1979 Find Greatest Common Divisor of Array Java $\text{\color{TealBlue}Easy}$ Array, Math, Number Theory
1995 Count Special Quadruplets Java $\text{\color{TealBlue}Easy}$ Array, Enumeration Solution Using Hash Table
2007 Find Original Array From Doubled Array Java with Hash Table, Queue or Counting Array $\text{\color{Dandelion}Medium}$ Array, Greedy, Hash Table, Sorting
2176 Count Equal and Divisible Pairs in an Array Java $\text{\color{TealBlue}Easy}$ Array
2438 Range Product Queries of Powers Java $\text{\color{Dandelion}Medium}$ Array, Bit Manipulation, Prefix Sum

⬆️Back To Top


Binary Search

# Problem Solution Difficulty Topics Note
1337 The K Weakest Rows in a Matrix Java with Heap (Priority Queue) or Sorting $\text{\color{TealBlue}Easy}$ Array, Binary Search, Heap (Priority Queue), Matrix, Sorting Solution Using Linear Search

⬆️Back To Top


Bit Manipulation

# Problem Solution Difficulty Topics Note
29 Divide Two Integers Java $\text{\color{Dandelion}Medium}$ Bit Manipulation, Math
371 Sum of Two Integers Java $\text{\color{Dandelion}Medium}$ Bit Manipulation, Math
393 UTF-8 Validation Java $\text{\color{Dandelion}Medium}$ Array, Bit Manipulation
1342 Number of Steps to Reduce a Number to Zero Java $\text{\color{TealBlue}Easy}$ Bit Manipulation, Math Solution Using Math
1486 XOR Operation in an Array Java $\text{\color{TealBlue}Easy}$ Bit Manipulation, Math
1680 Concatenation of Consecutive Binary Numbers Java $\text{\color{Dandelion}Medium}$ Bit Manipulation, Math, Simulation Solution Using Math
2438 Range Product Queries of Powers Java $\text{\color{Dandelion}Medium}$ Array, Bit Manipulation, Prefix Sum

⬆️Back To Top


Counting

# Problem Solution Difficulty Topics Note
383 Ransom Note Java $\text{\color{TealBlue}Easy}$ Counting, Hash Table, String Solution Using Hash Table

⬆️Back To Top


Dynamic Programming

# Problem Solution Difficulty Topics Note
1578 Minimum Time to Make Rope Colorful Java $\text{\color{Dandelion}Medium}$ Array, Dynamic Programming, Greedy, String

⬆️Back To Top


Enumeration

# Problem Solution Difficulty Topics Note
1995 Count Special Quadruplets Java $\text{\color{TealBlue}Easy}$ Array, Enumeration Solution Using Hash Table
2240 Number of Ways to Buy Pens and Pencils Java $\text{\color{Dandelion}Medium}$ Enumeration, Math

⬆️Back To Top


Geometry

# Problem Solution Difficulty Topics Note
593 Valid Square Java $\text{\color{Dandelion}Medium}$ Geometry, Math
812 Largest Triangle Area Java $\text{\color{TealBlue}Easy}$ Array, Geometry, Math

⬆️Back To Top


Greedy

# Problem Solution Difficulty Topics Note
334 Increasing Triplet Subsequence Java $\text{\color{Dandelion}Medium}$ Array, Greedy
948 Bag of Tokens Java $\text{\color{Dandelion}Medium}$ Array, Greedy, Sorting, Two Pointers
976 Largest Perimeter Triangle Java $\text{\color{TealBlue}Easy}$ Array, Greedy, Math, Sorting
1328 Break a Palindrome Java $\text{\color{Dandelion}Medium}$ Greedy, String
1578 Minimum Time to Make Rope Colorful Java $\text{\color{Dandelion}Medium}$ Array, Dynamic Programming, Greedy, String
2007 Find Original Array From Doubled Array Java with Hash Table, Queue or Counting Array $\text{\color{Dandelion}Medium}$ Array, Greedy, Hash Table, Sorting

⬆️Back To Top


Hash Table

# Problem Solution Difficulty Topics Note
1 Two Sum Java $\text{\color{TealBlue}Easy}$ Array, Hash Table
12 Integer to Roman Java $\text{\color{Dandelion}Medium}$ Hash Table, Math, String
13 Roman to Integer Java $\text{\color{TealBlue}Easy}$ Hash Table, Math, String Solution Without Hash Table
383 Ransom Note Java $\text{\color{TealBlue}Easy}$ Counting, Hash Table, String Solution Using Counting Array
609 Find Duplicate File in System Java $\text{\color{Dandelion}Medium}$ Array, Hash Table, String
929 Unique Email Addresses Java $\text{\color{TealBlue}Easy}$ Array, Hash Table, String
1679 Max Number of K-Sum Pairs Java $\text{\color{Dandelion}Medium}$ Array, Hash Table, Sorting, Two Pointers Solution Using Sorting & Two Pointers
1711 Count Good Meals Java $\text{\color{Dandelion}Medium}$ Array, Hash Table
1832 Check if the Sentence is Pangram Java $\text{\color{TealBlue}Easy}$ Hash Table, String Solution Without Hash Table
1935 Maximum Number of Words You Can Type Java $\text{\color{TealBlue}Easy}$ Hash Table, String
2007 Find Original Array From Doubled Array Java $\text{\color{Dandelion}Medium}$ Array, Greedy, Hash Table, Sorting Solution Using Queue or Counting Array

⬆️Back To Top


Heap (Priority Queue)

# Problem Solution Difficulty Topics Note
1337 The K Weakest Rows in a Matrix Java $\text{\color{TealBlue}Easy}$ Array, Binary Search, Heap (Priority Queue), Matrix, Sorting Solution Using Sorting

⬆️Back To Top


Math

# Problem Solution Difficulty Topics Note
12 Integer to Roman Java $\text{\color{Dandelion}Medium}$ Hash Table, Math, String
13 Roman to Integer Java $\text{\color{TealBlue}Easy}$ Hash Table, Math, String Solution Using Hash Table
29 Divide Two Integers Java $\text{\color{Dandelion}Medium}$ Bit Manipulation, Math
371 Sum of Two Integers Java $\text{\color{Dandelion}Medium}$ Bit Manipulation, Math
412 Fizz Buzz Java $\text{\color{TealBlue}Easy}$ Math, Simulation, String
593 Valid Square Java $\text{\color{Dandelion}Medium}$ Geometry, Math
812 Largest Triangle Area Java $\text{\color{TealBlue}Easy}$ Array, Geometry, Math
976 Largest Perimeter Triangle Java $\text{\color{TealBlue}Easy}$ Array, Greedy, Math, Sorting
1071 Greatest Common Divisor of Strings Java $\text{\color{TealBlue}Easy}$ Math, String
1103 Distribute Candies to People Java $\text{\color{TealBlue}Easy}$ Math, Simulation
1154 Day of the Year Java $\text{\color{TealBlue}Easy}$ Math, String
1342 Number of Steps to Reduce a Number to Zero Java $\text{\color{TealBlue}Easy}$ Bit Manipulation, Math Solution Using Bit Manipulation
1486 XOR Operation in an Array Java $\text{\color{TealBlue}Easy}$ Bit Manipulation, Math
1680 Concatenation of Consecutive Binary Numbers Java $\text{\color{Dandelion}Medium}$ Bit Manipulation, Math, Simulation Solution Using Bit Manipulation
1979 Find Greatest Common Divisor of Array Java $\text{\color{TealBlue}Easy}$ Array, Math, Number Theory
2169 Count Operations to Obtain Zero Java $\text{\color{TealBlue}Easy}$ Math, Simulation
2240 Number of Ways to Buy Pens and Pencils Java $\text{\color{Dandelion}Medium}$ Enumeration, Math
2413 Smallest Even Multiple Java $\text{\color{TealBlue}Easy}$ Math, Number Theory

⬆️Back To Top


Matrix

# Problem Solution Difficulty Topics Note
1337 The K Weakest Rows in a Matrix Java with Heap (Priority Queue) or Sorting $\text{\color{TealBlue}Easy}$ Array, Binary Search, Heap (Priority Queue), Matrix, Sorting
1672 Richest Customer Wealth Java $\text{\color{TealBlue}Easy}$ Array, Matrix

⬆️Back To Top


Number Theory

# Problem Solution Difficulty Topics Note
1979 Find Greatest Common Divisor of Array Java $\text{\color{TealBlue}Easy}$ Array, Math, Number Theory
2413 Smallest Even Multiple Java $\text{\color{TealBlue}Easy}$ Math, Number Theory

⬆️Back To Top


Prefix Sum

# Problem Solution Difficulty Topics Note
1480 Running Sum of 1D Array Java $\text{\color{TealBlue}Easy}$ Array, Prefix Sum
2438 Range Product Queries of Powers Java $\text{\color{Dandelion}Medium}$ Array, Bit Manipulation, Prefix Sum

⬆️Back To Top


Simulation

# Problem Solution Difficulty Topics Note
412 Fizz Buzz Java $\text{\color{TealBlue}Easy}$ Math, Simulation, String
985 Sum of Even Numbers After Queries Java $\text{\color{Dandelion}Medium}$ Array, Simulation
1103 Distribute Candies to People Java $\text{\color{TealBlue}Easy}$ Math, Simulation
1680 Concatenation of Consecutive Binary Numbers Java with Bit Manipulation or Math $\text{\color{Dandelion}Medium}$ Bit Manipulation, Math, Simulation
2169 Count Operations to Obtain Zero Java $\text{\color{TealBlue}Easy}$ Math, Simulation

⬆️Back To Top


Sorting

# Problem Solution Difficulty Topics Note
948 Bag of Tokens Java $\text{\color{Dandelion}Medium}$ Array, Greedy, Sorting, Two Pointers
976 Largest Perimeter Triangle Java $\text{\color{TealBlue}Easy}$ Array, Greedy, Math, Sorting
1337 The K Weakest Rows in a Matrix Java $\text{\color{TealBlue}Easy}$ Array, Binary Search, Heap (Priority Queue), Matrix, Sorting Solution Using Heap (Priority Queue)
1679 Max Number of K-Sum Pairs Java $\text{\color{Dandelion}Medium}$ Array, Hash Table, Sorting, Two Pointers Solution Using Hash Table
2007 Find Original Array From Doubled Array Java with Hash Table or Queue $\text{\color{Dandelion}Medium}$ Array, Greedy, Hash Table, Sorting Solution Using Counting Array

⬆️Back To Top


String

# Problem Solution Difficulty Topics Note
12 Integer to Roman Java $\text{\color{Dandelion}Medium}$ Hash Table, Math, String
13 Roman to Integer Java $\text{\color{TealBlue}Easy}$ Hash Table, Math, String Solution Using Hash Table
151 Reverse Words in a String Java with String or Collections Implementations $\text{\color{Dandelion}Medium}$ String, Two Pointers Solution Using Two Pointers
344 Reverse String Java $\text{\color{TealBlue}Easy}$ String, Two Pointers
383 Ransom Note Java with Counting Array or Hash Table $\text{\color{TealBlue}Easy}$ Counting, Hash Table, String
412 Fizz Buzz Java $\text{\color{TealBlue}Easy}$ Math, Simulation, String
609 Find Duplicate File in System Java $\text{\color{Dandelion}Medium}$ Array, Hash Table, String
929 Unique Email Addresses Java $\text{\color{TealBlue}Easy}$ Array, Hash Table, String
1071 Greatest Common Divisor of Strings Java $\text{\color{TealBlue}Easy}$ Math, String
1154 Day of the Year Java $\text{\color{TealBlue}Easy}$ Math, String
1328 Break a Palindrome Java $\text{\color{Dandelion}Medium}$ Greedy, String
1578 Minimum Time to Make Rope Colorful Java $\text{\color{Dandelion}Medium}$ Array, Dynamic Programming, Greedy, String
1592 Rearrange Spaces Between Words Java $\text{\color{TealBlue}Easy}$ String
1832 Check if the Sentence is Pangram Java $\text{\color{TealBlue}Easy}$ Hash Table, String Solution Using Hash Table
1935 Maximum Number of Words You Can Type Java $\text{\color{TealBlue}Easy}$ Hash Table, String
2315 Count Asterisks Java $\text{\color{TealBlue}Easy}$ String

⬆️Back To Top


Two Pointers

# Problem Solution Difficulty Topics Note
151 Reverse Words in a String Java $\text{\color{Dandelion}Medium}$ String, Two Pointers Solution Using Collections
344 Reverse String Java $\text{\color{TealBlue}Easy}$ String, Two Pointers
948 Bag of Tokens Java $\text{\color{Dandelion}Medium}$ Array, Greedy, Sorting, Two Pointers
1679 Max Number of K-Sum Pairs Java $\text{\color{Dandelion}Medium}$ Array, Hash Table, Sorting, Two Pointers Solution Using Hash Table

⬆️Back To Top


leetcode-java's People

Contributors

cheehwatang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.