Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- import requests
- import time
- def loesung(url_chall_7, url_sol_7) -> object:
- def search(listoo, k):
- for index1 in listoo:
- set = index1
- for index2 in listoo:
- if index2 == set:
- pass
- else:
- if set + index2 == k:
- v1 = listoo.index(set)
- v2 = listoo.index(index2)
- return [v1, v2] #match gefunden
- else:
- pass
- roh = requests.get(url=url_chall_7)
- json_roh = roh.json()
- k = int(json_roh['k'])
- lists: object = json_roh['list']
- solution = search(lists,k)
- dat = {"token": solution}
- result = requests.post(url=url_sol_7, data=json.dumps(dat))
- print(result.text) # success.ausgeben falls richtig
- #Main
- start = time.time()
- m = 100
- for i in range(m):
- loesung("https://cc.the-morpheus.de/challenges/7/", "https://cc.the-morpheus.de/solutions/7/")
- print((time.time() - start) / m)
Advertisement
Add Comment
Please, Sign In to add comment