given a list(just an example list, the actual test list is much MUCH longer)
d = [6610013121,4,6610021021,5, 6610021021,5,6610061121,5, 6610061121,5, 6610061121,1,6610000121,3, 6610000121,2, 6610000121,2, 6610000121,3]
where the long number is the student id number and the following number is the score(can be any positive or negative number) they receive.
The exercise is to add together the scores of each student and print them out as: list = [6610013121,4, 6610021021,10, 6610061121,11, 6610000121,8]
This requires me to find the duplicate id, add their respective points, and append that to a new list.
My problem is I can't figure out how to find duplicates id and add their scores together with these restrictions:
1. no dict() and set() allowed
2. no importing of library
3. if there are more than 4 scores remove the lowest one from the summation of that student. ex: [6610000121,3, 6610000121,2, 6610000121,2, 6610000121,3] is equal to [6610000121,8] since one of the "2" are considered lowest and removed
d = [6610013121,4,6610021021,5, 6610021021,5,6610061121,5, 6610061121,5, 6610061121,1,6610000121,3, 6610000121,2, 6610000121,2, 6610000121,3]
where the long number is the student id number and the following number is the score(can be any positive or negative number) they receive.
The exercise is to add together the scores of each student and print them out as: list = [6610013121,4, 6610021021,10, 6610061121,11, 6610000121,8]
This requires me to find the duplicate id, add their respective points, and append that to a new list.
My problem is I can't figure out how to find duplicates id and add their scores together with these restrictions:
1. no dict() and set() allowed
2. no importing of library
3. if there are more than 4 scores remove the lowest one from the summation of that student. ex: [6610000121,3, 6610000121,2, 6610000121,2, 6610000121,3] is equal to [6610000121,8] since one of the "2" are considered lowest and removed