@navitux
Sorting is dumb move in this case.
First: do a pass through the array, saving position and value of the highest one.

Then do a 2nd pass, where you grab the highest value the same way, but skip the field with highest value (as found during the 1st pass)

@kumicota @navitux
Yeah... That might require a few more lines of code, but I can see it working :ablobthinkingeyes:

@LukeAlmighty @kumicota I think that the meme pretends to show how when in interviews when you're start to talk, right or not, they stop you right there silently

@LukeAlmighty @navitux @kumicota

This just worked for me:

>>> myarray = [1, 2, 3, 4, 5, 6, 7, 55, 44, 33, 22, 15, 14, 13, 12, 11] >>> first = 0 >>> second = 0 >>> for i in myarray: ... if i > first: first = i ... if i > second and i < first: second = i ... >>> first 55 >>> second 44 >>>

Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.