Skip to content

Add smallest sum#13

Open
AshwinSri23 wants to merge 2 commits into
mainfrom
add-smallest-sum
Open

Add smallest sum#13
AshwinSri23 wants to merge 2 commits into
mainfrom
add-smallest-sum

Conversation

@AshwinSri23

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread questions/smallest-sum.md
Comment on lines +10 to +17
for(i in range(0,array.length)){
for(j in range(0,array.length)){
if((array[i]+array[j])<minSum){
minSums = (array[i]+array[j])
}
}

}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for(i in range(0,array.length)){
for(j in range(0,array.length)){
if((array[i]+array[j])<minSum){
minSums = (array[i]+array[j])
}
}
}
```python
for(i in range(0,array.length)){
for(j in range(0,array.length)){
if((array[i]+array[j])<minSum){
minSums = (array[i]+array[j])
}
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You could use the 3 backticks to format it in a nicer way

Comment thread questions/smallest-sum.md

Here is the problem statement:

Given a list of integers, you will need to find sum that can be created for a given list. For example, if the list was [1,6,9,4,3], the smallest sum of the list would be 4(3+1). Below is a way that you could go about finding smallest sum in an array:

@shannonpaul3 shannonpaul3 Oct 21, 2023

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The question is a little bit unclear. Maybe explaining why 4(3+1) is the solution could help!

Comment thread questions/smallest-sum.md

Here is the problem statement:

Given a list of integers, you will need to find sum that can be created for a given list. For example, if the list was [1,6,9,4,3], the smallest sum of the list would be 4(3+1). Below is a way that you could go about finding smallest sum in an array:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

cool question! Maybe try making the problem more clear. It could maybe be confusing in the first sentence where it says "you will need to find sum that can be created for a given list." Later in the sentence it is mentioned about smallest sum, maybe try adding that near the beginning to make idea more clear :)

@Antisune

Copy link
Copy Markdown
Collaborator

I think it would be good to say it is the sum of at least two elements to be more clear about the edge cases.
ie array is empty or array is size one, or if the student believes that the sum created by no elements is the smallest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants