class UserMainCode(object):
@classmethod
def range(cls, input1, input2):
pass
Example:
input1: (1,1,2)
input2: 3
Output: {1}
class UserMainCode(object):
@classmethod
def range(cls, input1, input2):
pass
Example:
input1: (1,1,2)
input2: 3
Output: {1}
Copyright © 2021 Jogjafile Inc.
The following code below would do the trick. It uses the
collections .Counterto count all items in the list/tuple. The code also uses the new type hinting from Python 3 to enable static analysis.It's also possible to eliminate
input2entirely as lists/tuples/dicts... have the length read by the functionlen