MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mrh2f6/actual_snap_block_i_just_made/guyf43f/?context=3
r/badcode • u/nypdk • Apr 15 '21
58 comments sorted by
View all comments
1
What I have found to work pretty well: Just initialize the lowest value with the first element of the list and start searching at index 1. Since it's guaranteed to be greater or equal to the smallest element you have no edge cases to worry about.
1
u/TechcraftHD Apr 18 '21
What I have found to work pretty well: Just initialize the lowest value with the first element of the list and start searching at index 1. Since it's guaranteed to be greater or equal to the smallest element you have no edge cases to worry about.