Advertisement
vesso8

Numbers Search

Jun 26th, 2021
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def numbers_searching(*args):
  2.     duplicates = []
  3.     missing_number = 0
  4.     for nums in range(len(args)):
  5.         for index in range(nums+ 1, len(args)):
  6.             if args[nums] == args[index] and args[nums] not in duplicates:
  7.                 duplicates.append(args[nums])
  8.     for n in range(min(args), max(args)):
  9.         if n not in duplicates:
  10.             missing_number = n
  11.             break
  12.     return [missing_number , sorted(duplicates)]
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement