00:01
Right, so we are doing a pretty simple case here, a little bit of user input and then finding the middle item.
00:09
So i'm going to go with the question's assumption that the list is sorted, and it's actually not very clear in this case, but i've just coded out the whole solution so you can have a look for yourself, right? so we're going to start with an empty number list, have an infinite loop which will input values into the number list.
00:29
In this case, i've chosen the letter capital d as the condition to stop entering your input.
00:36
And if the user does not input d, we are going to try and add the user input to the list using an integer casting.
00:47
And if that integer casting fails for any reason, it will not append that value to the list.
00:54
So after we finish creating the list, we will sort it as the question assumed it was sorted.
01:00
I'm not going to implement my own sort here, get the length of the list, and handle two error cases.
01:08
And if those two error cases do not happen, then we can simply print out our answer...