Skip to content

Added the Other algorithm category and an algorithm of find DateToDay method#663

Merged
raklaptudirm merged 8 commits intoTheAlgorithms:masterfrom
suryapratapsinghsuryavanshi:master
Aug 23, 2021
Merged

Added the Other algorithm category and an algorithm of find DateToDay method#663
raklaptudirm merged 8 commits intoTheAlgorithms:masterfrom
suryapratapsinghsuryavanshi:master

Conversation

@suryapratapsinghsuryavanshi
Copy link
Copy Markdown
Contributor

Welcome to JavaScript community

Open in Gitpod know more

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new JavaScript files are placed inside an existing directory.
  • All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.
    Example:UserProfile.js is allowed but userprofile.js,Userprofile.js,user-Profile.js,userProfile.js are not
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

Copy link
Copy Markdown
Member

@raklaptudirm raklaptudirm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does not teach anything new. I should suggest trying to implement the day getting by hand, which will we more interesting than using an in-built class.
If you do change that, I believe this file is better suited in the /Conversions/ catagory.

@raklaptudirm raklaptudirm added changes required This pull request needs changes on hold Being discussed by the maintainers labels Aug 22, 2021
@suryapratapsinghsuryavanshi
Copy link
Copy Markdown
Contributor Author

Sorry, but I don't get your point "I should suggest trying to implement the day getting by hand" can you more elaborate on this point, I think this is more exciting for me to implement something new.

@raklaptudirm
Copy link
Copy Markdown
Member

@sukhpreetsekhon I meant that I do not like the way you have used the Date class to get the day. That detail means your algorithm provides no new knowledge tactic for problem solving, and we of course do not want that. I want you to create a function to find the day which will not exploit native behavior. Like for finding the day, you could calculate the number of days passed from a known date, and calculate the day using that.

@suryapratapsinghsuryavanshi
Copy link
Copy Markdown
Contributor Author

Thanks, I have already built such a method in my open-source npm package (SolverJs). Can you like to see it and make some suggestions? and my name is @suryapratapsinghsuryavanshi. 😄

@raklaptudirm
Copy link
Copy Markdown
Member

@suryapratapsinghsuryavanshi I think you did not understand what I meant. I said the idea of finding the day was good, but implementing it using the Date Class is sort of cheating, and people who see that algorithm do not learn anything new. I wanted you to implement finding the day yourself, and not using the Date class.

@suryapratapsinghsuryavanshi
Copy link
Copy Markdown
Contributor Author

Sorry, I guess this time I've implemented what you wanted.

@raklaptudirm raklaptudirm merged commit 046a901 into TheAlgorithms:master Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes required This pull request needs changes on hold Being discussed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants