Skip to content

Conversation

@ederalab
Copy link
Contributor

@ederalab ederalab commented Oct 7, 2021

my solution in python

-export([start/0]).

start() ->
MyList=[230, 222, 220, 224, 229, 221, 225, 223, 228, 226],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please create a function that gets the list as an input and return the result?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hint: Try creating a function like findMissingNumber that takes a list as input and returns the missing number as output. Then call it inside your main function to test it out

Copy link
Collaborator

Choose a reason for hiding this comment

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

Other hint:

findMissingNumber(MyList) ->
  sum(lists:seq(lists:min(MyList), lists:max(MyList))).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the code after your hint, it seems to work.

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