Skip to content

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

Open
dracconi wants to merge 2 commits into
ocaml:masterfrom
dracconi:patch-1
Open

Add a solution for "94. An arithmetic puzzle." in 99 Problems#1597
dracconi wants to merge 2 commits into
ocaml:masterfrom
dracconi:patch-1

Conversation

@dracconi

@dracconi dracconi commented Jul 25, 2021

Copy link
Copy Markdown

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
Copy Markdown
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

dracconi commented Aug 7, 2021

Copy link
Copy Markdown
Author

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