Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a solution for "94. An arithmetic puzzle." in 99 Problems #1597

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dracconi
Copy link

@dracconi dracconi commented Jul 25, 2021

Changes Made

Added a solution to the 94th problem in 99 Problems.
Seems to work, but who knows :D

Done per request for commits "Please contribute more solutions or improve the existing ones."

  • Please check if the PR fulfills these requirements
  • PR is descriptively titled and links the original issue above
  • Before/after screenshots (if this is a layout change)
  • Details of which platforms the change was tested on (if this is a browser-specific change)
  • Context for what motivated the change (if this is a change to some content)

@patricoferris
Copy link
Contributor

Hi @dracconi thanks for the PR, I haven't checked your solution (I'm not brilliant at algorithms) but could you maybe refactor the code to follow the pattern many of the others follow which uses the > to indent the solution and then reuses the implemented function on some of the examples in a code block below ? This will render quite nicely on the front-end then https://ocaml.org/learn/tutorials/99problems.html and also will render the output of a "top level" function that takes as input the arguments described in the text such as:

```ocamltop
f [2; 3; 5; 7; 11];;
```

This will then output on the site (if the solution is correct ;)) as something like:

f [2; 3; 5; 7; 11];;
- : string = "2 - 3 + 5 + 7 = 11"

Thanks :))

@dracconi
Copy link
Author

dracconi commented Aug 7, 2021

Hi @patricoferris, I've commited the updated thing per request, though I'm not sure if the example should be exactly the same as listed in the example [2; 3; 5; 7; 11], or can it be different?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants