Skip to content

Instantly share code, notes, and snippets.

@igul222
Created February 12, 2014 02:05
Show Gist options
  • Select an option

  • Save igul222/8948654 to your computer and use it in GitHub Desktop.

Select an option

Save igul222/8948654 to your computer and use it in GitHub Desktop.
arr2_pos = 0
product = 0
for each thing1 in arr1:
while arr2[arr2_pos][0] <= thing1[0]:
arr2_pos++
if arr2[arr2_pos][0] == thing1[0]:
product += arr2[arr2_pos][1] * thing1[1]
return product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment