C
C
ctocopok2015-11-12 09:48:53
Data Comparison
ctocopok, 2015-11-12 09:48:53

How to compare strings and find out the difference?

I monitor student grades on the education portal.
From the progress page, you can get student grades as a solid string, say "5553525435"
As far as I know, the portal does not give the teacher the ability to correct grades, which simplifies my task. However, a grade can be "backdated", i.e. to be in the middle or the beginning of an existing row of grades.
For example (was-was)
5553525435
55535254435 The
question is how to identify the "inserted" assessment. Unfortunately, the number of changes at a time is not limited. Several grades may appear, put down on different days - in a single package.
How to determine which estimates are new (well, and then find out the position in which the change occurred).
Thanks in advance.
I will write in python, but in principle, the language is not important.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2015-11-12
@ctocopok

Как вариант идти по длинному массиву вычитая одинаковые оценки из меньшего массива.Так до тех пор пока сумма меньшего массива не будет равна 0,вы узнаете оценки которые были добавлены,но позиция в данном варианте будет неточная при одинаковых оценках..Допустим при
555555 изменении в
555555555
вы никогда не узнаете в какое место было добавлена оценка(может одна в начало,одна в середину).Так что либо формат исходных данных менять,либо не брать точное место изменения

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question