Posts

Showing posts from November 8, 2018

Merge pairs on common integer with restrictions

Merge pairs on common integer with restrictions I need an efficient way to merge a list of nodes (pairs of integers). The merge should happen only if there is one common number in the pair and the common number is on the first or the last position (otherwise its allready connected). For example: mylist = [[4, 3], [6, 3]] merge_links(mylist) # should output [4, 3, 6] another example: mylist = [[4, 3], [6, 3], [6, 4]] merge_links(mylist) # should output again [4, 3, 6] because both 6 and 4 allready exist in array. and yet another example: mylist = [[4, 3], [6, 3], [6, 4], [6, 2], [7, 4], [4, 9]] merge_links(mylist) # should output [7, 4, 3, 6, 2] # [4, 3] ✔ # [4, 3] + [6, 3] ✔ -> [4, 3, 6] # [4, 3, 6] + [6, 3] ✘ both 6 and 3 exist in [4, 3, 6] # [4, 3, 6] + [6, 4] ✘ both 6 and 4 exist in [4, 3, 6] # [4, 3, 6] + [6, 2] ✔ -> [4, 3, 6, 2] # [4, 3, 6, 2] + [7, 4] ✔ -> [7, 4, 3, 6, 2] # [7, 4, 3, 6, 2] + [4, 9] ✘ 4 is allready connected "7-4-3"! Currently I'm u

Stay extension in the US and Visa stamp

Image
up vote 1 down vote favorite I have had my staying in the US limited for 3 weeks only , with a stamp on my passport , when I was intending to spend 3 months as a maximum or just as long as i can stay in the country since Im visiting both my best friend and boyfriend. What can I do to have my staying extended as much as possible ? visas usa passport-stamps visa-extensions share | improve this question edited Sep 18 '17 at 16:30 user102008 10.8k 1 21 49 asked Sep 18 '17 at 16:17 Starfall Shaimie 8 2 1 Did your limited admission just happen randomly, or did the border guards give you some kind of indication of why you got only 3 weeks? – Henning Makholm Sep 18 '17 at 16:22 2 In what status were you admitted? – phoog Sep 18 '17 at 16:52 Also when you entered did you tell the CBP officer you intended to stay 3 months, or is the 3 weeks you got the stay you requested? – Dennis Sep 1