karpovigorok/leetcode

Leetcode.com problem solve using php language

v1.0 2021-07-30 14:31 UTC

This package is auto-updated.

Last update: 2024-06-22 17:24:27 UTC


README

Clone is Free, press the Star also is free!

Leetcode.com problem solve using php language

How To

Get via composer

composer require karpovigorok/leetcode

Structure

src directory contain Solution classes
result directory contain examples of use

Example

<?php
use Leetcode\CountPrimes\Solution;
$solution = new Solution();
echo $solution->countPrimes(499979) . PHP_EOL;

Solved

Difficulty: Easy

  1. Two Sum php and js
  2. Two Sum II - Input array is sorted
  3. Reverse Integer
  4. Palindrome Number php
  5. Palindrome Number js
  6. Palindrome Linked List
  7. Valid Palindrome
  8. Valid Palindrome II
  9. Roman to Integer
  10. Longest Common Prefix
  11. Count Primes
  12. Sqrt(x)
  13. Valid Parentheses
  14. Implement strStr()
  15. Merge Sorted Array
  16. Remove Duplicates from Sorted Array
  17. Min Stack
  18. Merge Two Sorted Lists
  19. Search Insert Position
  20. First Bad Version
  21. Guess Number Higher or Lower
  22. Maximum Subarray
  23. Majority Element

Difficulty: Medium

  1. Sum of Two Integers
  2. Rotate Array
  3. Swap List Nodes