Skip to content

PalmaAnd/Programming-Problems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Programming-Problems

This repository contains my solutions to various LeetCode problems. The solutions are implemented in both Java and JavaScript. The Java solutions are located in the Java/src/ directory, while the JavaScript solutions are divided into problem implementations in js/Problems/ and corresponding Jest test cases in js/Tests/.

Links to my profiles

Table of Contents

Current Solutions

Here is a list of the problems I've solved along with links to the corresponding LeetCode problem:

Problem Solution
Two Sum JavaScript
Palindrome Number JavaScript
Contains Duplicate JavaScript
Valid Anagram JavaScript
Valid Palindrome JavaScript
Two Sum II - Input Array Is Sorted JavaScript
Group Anagrams Java
Product of Array Except Self Java
Top K Frequent Elements Java
Merge Sorted Array Java
Merge Two Sorted Lists Java
Reverse Linked List Java
Daily Temperatures Java
Min Stack Java
Evaluate Reverse Polish Notation Java
3Sum Java
Remove Element Java
Longest Common Prefix Java
Search Insert Position Java
Roman to Integer Java
Roman to Integer Java

Java Solutions

The Java/src/ directory contains my Java implementations for LeetCode problems. Each problem is implemented in its own Java file and test file. Java is build ontop of a Maven project for easier testing and in general structure.

JavaScript Solutions

The JavaScript solutions are divided into two parts:

  1. Problem Implementations: The JavaScript problem implementations are located in the js/Problems/ directory. Each problem is implemented in its own JavaScript file.

  2. Jest Test Cases: The corresponding Jest test cases for the JavaScript problems are located in the js/Tests/ directory. Each problem has its own test file that ensures the correctness of the implementation.

Getting Started

  1. Clone the Repository: Clone this repository to your local machine using the following command:

    git clone https://github.com/PalmaAnd/Programming-Problems.git
  2. Navigate to the Directory: Change into the repository directory:

    cd Programming-Problems
  3. Select a Solution: Navigate to the directory of the specific problem you're interested in. For Java solutions, navigate to Java/src/. For JavaScript solutions, navigate to js/Problems/.

Running Tests

  1. Install Dependencies: Before running the tests, make sure you have Node.js and npm installed on your machine. Then, navigate to the project's root directory and install the required dependencies:

    npm install
  2. Run Tests: To run the Jest tests for the JavaScript solutions, navigate to the js/Tests/ directory and execute the following command:

    npm test

    This command will run all the test cases and display the results.

License

This project is licensed under the MIT License.