def solution(numbers, hand): phone = [[1, 4, 7, '*'], [2, 5, 8, 0], [3, 6, 9, '#']] used = [] last_l = (0, 3) last_r = (2, 3) for i in numbers : if i in phone[0] : used.append("L") last_l = (0, phone[0].index(i)) elif i in phone[2] : used.append("R") last_r = (2, phone[2].index(i)) else : now = (1, phone[1].index(i)) d_l = abs(last_l[0] - now[0]) + abs(last_l[1] - now[1]) d_r = abs(last_r[0] - n..