Python Forum
Struggling To Understand These 2 Python Files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Struggling To Understand These 2 Python Files
#2
The idea is easy to understand, take the list
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
If you remove 0, 1, 2, 3 or 4, then L[4] has value 5. On the other hand, if you remove 5, 6, 7, 8 or 9, then L[4] has value 4. Hence by checking the value of L[4], you can say if the missing value is in range(0, 5) or in range(5, 10). The algorithm then repeats the same argument for the subarrays.
Reply


Messages In This Thread
RE: Struggling To Understand These 2 Python Files - by Gribouillis - Sep-22-2020, 04:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Struggling on Tuples Mystix 3 4,938 Feb-01-2021, 06:06 PM
Last Post: nilamo
  Struggling with variables pythonstudy00 1 1,522 Sep-23-2020, 06:39 AM
Last Post: DPaul
  struggling w/ fonctions in Python Tiril123 7 3,894 May-09-2020, 10:51 AM
Last Post: pyzyx3qwerty
  struggling with one part of python Lucifer 23 6,939 May-08-2020, 12:24 PM
Last Post: pyzyx3qwerty
  struggling with python save/load function newatpython00 1 2,028 Nov-15-2019, 07:58 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020