Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

99 Elm Problems/Problem 93

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Given a list of integer numbers, find a correct way of inserting arithmetic signs (operators) such that the result is a correct equation, if possible. Example: [2,3,5,7,11] we can form the equations 2-3+5+7 = 11 or 2 = (3*5+7)/11 (and ten others). Division should be interpreted as operating on rationals, and division by zero should be avoided. # # # THIS IS A STUB # # # Example in Elm: import Html exposing (text) import List f : Int -> Int -- your implementation goes here main = text (toString (f 0)) Result: 4 Solutions