TheAlgorithms / PHP

All Algorithms implemented in PHP
MIT License
2.14k stars 467 forks source link

Two Pointers Algorithm added in PHP/Searches/TwoPointers.php #152

Closed arafinmridul closed 5 months ago

arafinmridul commented 6 months ago

Definition, Usage and Step by step Two Pointers technique implementation in PHP with example problem. Explained in every step with proper comments.

arafinmridul commented 6 months ago

For the ./Searches/TwoPointers.php file, Added file path in Directory.md. Added unit test cases.

darwinz commented 5 months ago

Looking much better. Thank you for adding the file path in Directory.md, and adding a proper unit test. The linter is complaining about one issue. Fix this issue, and we should be able to merge.

FILE: /home/runner/work/PHP/PHP/Searches/TwoPointers.php
------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
 1 | ERROR | [x] Header blocks must be separated by a single blank line
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------
darwinz commented 5 months ago

Thanks for updating, @arafinmridul . Looks like you still have a linter issue. Please address this.

FILE: /home/runner/work/PHP/PHP/Searches/TwoPointers.php
------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
 1 | ERROR | [x] Header blocks must be separated by a single blank line
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

If you run vendor/bin/phpcs -n locally after making a fix, you can see any errors and ensure there aren't any after each fix you do.