@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)
@mystik @LukeAlmighty @kumicota I explained that's NOT the point, but thanks
@LukeAlmighty @mystik @kumicota I think so 😅
@mystik @LukeAlmighty @kumicota I'm using the browser, it's good I think
@mystik @LukeAlmighty @kumicota Are mastodon sites blocked/censored in your country?
Sorry, it's the worst
@mystik @LukeAlmighty @kumicota I see, is this for privacy or just for speed up sites (it would be ironical)
@mystik @LukeAlmighty @kumicota good for you, no one cares about that until they got hacked or backmailed
@mystik @LukeAlmighty @kumicota by the way: Do you recommend some good free-paid proxy or VPN ??
Because I heard about using TOR as vpn, but I'm not sure if it really works
@mystik @LukeAlmighty @kumicota I see
@mystik @LukeAlmighty @kumicota Hi Mystik, by the way, I got curious, and I'm using mastodon web client with TOR network as Proxy for privacy some hours ago and I found it more than usable, the UX is good for me
@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 >>>