39
H0r4c3
18 42 52 Leader of the month
9201/ 9695
Horatiu Crista
Last seen 1 day ago
Member for 2 years, 6 months, 15 days
Difficulty Normal
Python, Python, Python...

Missions (413) / Solutions (328)
Best solutions / Newest solutions
Initiation
First
End Zeros
continue
range
else
int
str
6
2
Using append and del
Replace First
typing.Iterable
Iterable
typing
append
list
6
Using zip_longest() from itertools
Remove All Before
itertools.zip_longest
zip_longest
f-string
itertools
index
6
Using collections.Counter.most_common()
The Most Frequent
collections.Counter
Counter
collections
list
str
8
First
Max Digit
max
list
int
str
9
a*b
Multiply (Intro)
11
First
Correct Sentence
upper
str
if
15
First
Beginning Zeros
lstrip
int
str
len
2
Using slicing
Replace First
typing.Iterable
Iterable
typing
list
2
Using isupper()
All Upper I
continue
isupper
bool
or
in
1
First
Between Markers (simplified)
index
str
4
One line solution
Easy Unpack
tuple
Using namedtuple from collections
Max Digit
collections.namedtuple
namedtuple
collections
max
print
First
Sum Numbers
re.compile
compile
findall
re.findall
map
First
Nearest Value
sort
index
abs
set
lambda
First
Number Length
int
str
len
2
First
Split Pairs
list-comp
range
comprehension
len
if
Using index
Remove All Before
typing.Iterable
Iterable
typing
list
int
2
First
First Word (simplified)
split
str
Using set
All the Same
Any
typing.Any
List
typing.List
bool
1
Home
First with explanations
Missing Number
sort
index
max
print
list-comp
2
First
Sort Array by Element Frequency
itertools.repeat
repeat
dict
itertools
lambda
6
4
Creating a list with changes in direction
Changing direction
print
if-comprehension
elif
append
list-comp
11
2
Using list comprehensions
Duplicate Zeros
isinstance
inline-if
print
list-comp
list
First
First Word
re.compile
compile
findall
re.findall
re
1
Using replace() and find()
Second Index
find
None
replace
int
str
2
First
Three Words
isalpha
bool
False
True
split
2
First
Pawn Brotherhood
chr
ord
continue
set
or
2
First
Between Markers
find
and
str
len
if
1
First
Split List
append
list
len
if
Twice split
Morse Decoder
capitalize
strip
split
for
2
First
Date and Time Converter
or
else
int
str
if
First
Popular Words
dict
lower
count
split
list
First
Bigger Price
lambda
sorted
True
list
int
1
Second - using yield
Non-unique Elements
yield
count
list
for
if
2
First
Second Index
find
None
replace
int
str
First
Days Between
date
datetime.date
datetime
if
First
Right to Left
tuple
replace
join
append
list
First
Even the Last
sum
list-comp
range
list
comprehension
2
First
Non-unique Elements
count
append
list
for
if
Electronic Station
Using numpy and itertools/groupby
Find Sequence
fliplr
numpy.fliplr
groupby
itertools.groupby
numpy.array
2
2
With comments
Blood distribution
dict
print
else
int
str
15
Regex
Acceptable Password V
findall
re.findall
re
bool
lower
2
Using regex
Unix Match. Part 2
re.compile
compile
re.sub
sub
re.search
2
Using regex and islower()
All Upper II
re.compile
compile
findall
re.findall
islower
2
Regex
Acceptable Password IV
findall
re.findall
re
bool
or
3
First
Acceptable Password II
findall
re.findall
re
bool
False
2
Using itertools.combinations and replace()
Remove Brackets
combinations
itertools.combinations
itertools
enumerate
replace
1
Using regex
Unix Match. Part 1
re.compile
compile
re.search
search
re
1
len() and set()
Surjection Strings
zip
set
False
True
list
3
The three pairs of sides must be in proportion
Similar Triangles
Tuple
typing.Tuple
List
typing.List
bool
Using regex
Acceptable Password III
findall
re.findall
re
bool
False
2
Using regex, rsplit and sort with 2 keys
Sort by Extension
rsplit
re.compile
compile
extend
findall
Simple
Boolean Algebra
not
or
and
if
1
Using index() method
Words Order
bool
set
sorted
in
False
First
Ascending List
typing.Iterable
Iterable
bool
typing
False
Using regex
Acceptable Password VI
findall
re.findall
re
bool
set
1
Using regex
Brackets
findall
re.findall
any
re
replace
1
One liner using sorted(), lower, replace()
Verify Anagrams
replace
lower
sorted
1
First
Digits Multiplication
int
str
for
if
Scientific Expedition
Using for, if and dictionary comprehension
Convert and Aggregate
f-string
dict-comp
keys
dict
items
7
Using re and Counter
The Most Wanted Letter
re.compile
compile
collections.Counter
Counter
findall
8
One-liner
Convert To Title Case
capitalize
print
join
list-comp
split
9
First
Letter Queue
List
typing.List
typing
join
in
9
2
Using re and upper()
Caps Lock
startswith
re.split
upper
index
re
13
2
One-liner using the replace method
Replace All Occurrences
replace
print
str
17
2
List Comprehension
Count Vowels
print
if-comprehension
in
list-comp
comprehension
19
for... if... else
Longest Substring of Unique Characters
index
print
range
else
int
Using defaultdict and ceil()
Call to Home
math.ceil
ceil
collections.defaultdict
defaultdict
items
2 Solutions: 1. regex and 2. one-liner
Conversion into CamelCase
capitalize
re.sub
sub
re
join
2
Using a list of following consecutive digits
Beat The Previous
replace
print
while
append
list-comp
Using regex
YAML. Simple Dict
splitlines
isnumeric
re.compile
compile
strip
Regex FTW
Count Substring Occurrences
finditer
re.finditer
f-string
re
lower
Using regex
Count Vowels
IGNORECASE
re.IGNORECASE
re.compile
compile
findall
Using unicodedata
Remove Accents
category
unicodedata.category
normalize
unicodedata.normalize
unicodedata
3
2 solutions: isupper() and regex
Conversion from CamelCase
re.sub
sub
r-string
isupper
re
1
Using strptime() and strftime() methods from datetime class
Time Converter (24h to 12h)
datetime.strptime
strptime
datetime.datetime
datetime
lstrip
Using lists, find(), index()
The Hidden Word
splitlines
find
index
None
replace
Using dataclass
I Love Python!
dataclass
dataclasses
dataclasses.dataclass
class
print
Using regex
YAML. More Types
splitlines
startswith
isnumeric
re.compile
compile
2
Second - Using regex
YAML. More Types
splitlines
startswith
isnumeric
re.compile
compile
Using isinstance()
Sum by Type
Tuple
typing.Tuple
isinstance
typing
elif
Using for and if
Follow Instructions
Tuple
typing.Tuple
tuple
continue
typing
2
Using numpy
Cipher Map
concatenate
numpy.concatenate
numpy.rot90
rot90
numpy.array
2 solutions: one-liner using set
Pangram
ascii_lowercase
string.ascii_lowercase
string
set
lower
2
First
I Love Python!
One-liner using regex
Secret Message
findall
re.findall
re
join
str
Using index()
Goes Right After
index
bool
except
try
False
2
Using re.sub()
Bird Language
re.sub
sub
re
str
for
Solved using two methods: 1. Lists 2. Sets
Common Words
intersection
set
sorted
join
in
Using regex and slice with step 2
Striped Words
re.split
re.compile
compile
all
re
First
Absolute Sorting
abs
lambda
sorted
list
2
O'Reilly
Using Numpy
Reverse Every Ascending
numpy.split
diff
numpy.diff
numpy.where
where
1
Using pandas and flatten()
Flatten a List (iterator version)
flatten
pandas.core.common.flatten
pandas
iter
1
2 Solutions: itertools.groupby() and numpy.where() and delete()
Compress List
delete
numpy.delete
diff
numpy.diff
numpy.where
2
2 Solutions: 1. using recursion 2. using pandas and json_normalize (not ok for all tests)
The Flat Dictionary
json_normalize
pandas.json_normalize
pandas
isinstance
extend
3
2
2 Solutions: 1. One-liner using pandas and flatten() 2. Using itertools and chain()
Flatten a List
flatten
pandas.core.common.flatten
pandas
collections.abc.Iterable
chain
8
Using datetime, strptime(), strftime()
Time Converter (12h to 24h)
datetime.strftime
strftime
datetime.strptime
strptime
datetime.datetime
14
2
Finding position in ALPHABET tuple of tuples
String-2-Matrix
islower
tuple
lower
inline-if
print
17
Convert the decimal number to another base + use slice
Integer Palindrome
chr
ord
bool
print
while
18
For, for, if, elif + ALPHABET
Matrix-2-String
upper
tuple
print
elif
range
19
Using recursion
The Final Stone
print
sorted
list
int
len
3
Using recursion
How Deep
map
except
try
max
inline-if
2
Brute force using all combinations
Loading Cargo
combinations
itertools.combinations
itertools
remove
min
One-liner using slice
Chunk
typing.Iterable
Iterable
typing
list-comp
range
Using recursion and list(), str(), int(), map()
Sum of Digits
f-string
map
sum
print
list
Using total_seconds()
Lightbulb Intro
datetime.datetime
datetime
List
typing.List
typing
Using slicing
Replace Last
list
Using itertools module and combinations class
Count Inversions
combinations
itertools.combinations
itertools
print
if-comprehension
1
Using pandas and numpy
Xs and Os Referee
Series
pandas.Series
diag
numpy.diag
DataFrame
Second
Lightbulb End Watching
datetime.max
Optional
typing.Optional
datetime.datetime
datetime
Simple
Median of Three
typing.Iterable
Iterable
typing
sorted
append
2
Second
Remove All After
index
typing.Iterable
Iterable
typing
list
2
Used itertools, chain() and isinstance()
Flatten a List
collections.abc.Iterable
chain
itertools.chain
isinstance
extend
2
First
Index Power
list
int
len
if
2
Using total_seconds()
Lightbulb Start Watching
Optional
typing.Optional
datetime.datetime
datetime
List
Using slice
Remove All After
index
typing.Iterable
Iterable
typing
list
2
Using enumerate()
Sort Except Zero
insert
sort
enumerate
typing.Iterable
Iterable
2
Using Counter() class and itertools module
Frequency Sorting
itertools.repeat
repeat
extend
collections.Counter
Counter
2
Using slice
Replace Last
list
else
len
if
2
Using count()
Majority
bool
count
False
True
list
2
Third
Replace Last
or
list
else
len
if
2
First
Median
float
List
typing.List
typing
sorted
Incinerator
First
Army Battles
class
property
super
decorator
pass
Clear
Army Units
class
f-string
2
OOP
Every Person is Unique
class
datetime.strptime
strptime
f-string
datetime.datetime
2
First
Capital City
class
None
not
if
2
First
The Defenders
class
property
super
decorator
f-string
2
Using math, decorator, inheritance
Geometry Figures
math.tan
tan
class
math.pi
super
OOP
Dialogues
class
None
inline-if
print
join
Inheritance
3 Chefs
class
f-string
Clear
The Vampires
class
property
super
decorator
f-string
First
The Warriors
class
property
super
decorator
pass
OOP
Building Base
class
f-string
dict
Mine
First
Fibonacci Poem
functools.lru_cache
lru_cache
decorator
functools
count
3
A Long Solution
Aggregate by Operation
setdefault
rfind
eval
dict-comp
pass
8
Using functools.cmp_to_key()
Bigger Together
cmp_to_key
functools.cmp_to_key
reversed
functools
List
11
One liner: using list comprehension in dictionary comprehension
Switch Keys to Values
values
dict-comp
keys
dict
set
13
One-liner using integer division (//)
Count Divisibles in Range
print
int
13
Using regex, ord(), chr()
Caesar Cipher (decryptor)
re.compile
compile
pass
chr
ord
16
2
Using numpy and the coordinates of the neighbors
Moore Neighbourhood
numpy.array
array
numpy
as
None
10
Using while and if
Adjacent Letters
pop
print
join
while
list
For, Slice, Max
Replace with Biggest
typing.Iterable
Iterable
max
typing
print
Using groupby class and Counter class
Long Pressed
groupby
itertools.groupby
collections.Counter
Counter
keys
One-liner using numpy
Determinant
numpy.linalg
linalg
numpy.array
array
numpy
Using recursion
Chess Knight
clear
itertools.product
product
extend
get
First
Cut Sentence
range
int
str
len
for
2
Pure math
Achilles and the Tortoise
print
2
Using math.gcd()
The Greatest Common Divisor
math.gcd
gcd
math
int
One-liner using max with key
Best Stock
dict
max
lambda
str
2
Using if, elif, else
Currency Style
ip_address
ipaddress.ip_address
ipaddress
ValueError
pass
Using bin()
Binary Count
bin
lstrip
count
int
2
First
Fizz Buzz
elif
and
else
int
str
1
Using ord() and chr()
Caesar Cipher (encryptor)
chr
ord
else
for
if
Ice Base
One-liner using isupper(), islower(), istitle()
Correct Capital
istitle
islower
isupper
bool
or
1
8
Using regex and too many if
Reveal the Number
eval
findall
re.findall
float
enumerate
1
Using Polygon Class from sympy Module
Interesting, intersecting
sympy.Polygon
Polygon
sympy
intersection
tuple
1
try...except
Is String a Number?
bool
except
try
print
False
3
Regex FTW!
Count And Say
finditer
re.finditer
r-string
re
print
3
4
find_divisors function
Perfect Number Checking
bool
sum
print
False
append
7
3
Using combinations Class
One Switch Strings
combinations
itertools.combinations
itertools
bool
print
7
2
One-linear
Leap Year Checking
bool
or
print
False
and
8
1
One-liner using isupper(), islower()
Correct Capital
islower
isupper
bool
or
print
9
1
One-liner
Move Zeros
typing.Iterable
Iterable
typing
count
print
9
Using regex
Is String a Number? (Part II)
re.search
search
r-string
re
bool
9
1
Using fractions and Fraction
Oil Pie
Fraction
fractions.Fraction
fractions
f-string
map
11
Using count, reverse, remove
When "k" is Enough!
reverse
remove
typing.Iterable
Iterable
typing
13
My Solution has a bug (didn't pass a test)
Making Change
f-string
continue
None
inline-if
print
13
Using if, elif and f-string
Write Quadratic Equation
re.sub
sub
f-string
re
abs
With prints
Quadratic Equation Roots
typing.Union
Union
collections.abc.Iterable
math.sqrt
sqrt
Iteration
Count And Say
print
join
append
range
list
Analytic Geometry
Interesting, intersecting
tuple
bool
or
print
False
Using zip Class
Not in Order
zip
print
sorted
list
int
Using <in> keyword
Monkey Typing
set
lower
in
int
str
Using re and finditer()
Long Repeat
re.compile
compile
r-string
sort
re
2
Calculating pigeons and portions for every minute
Feed Pigeons
f-string
values
dict-comp
items
break
2 one-liner solutions: using re and using split() and slice
Find Quotes
findall
re.findall
r-string
re
split
Creating two sets with all the links for first and second
How to Find Friends
union
intersection
set
inline-if
in
Using hypot and floor from math
Counting Tiles
math.hypot
hypot
math.floor
floor
math
With explanations
Clock Angle
min
abs
list-comp
split
comprehension
Using OrderedDict and //
Roman Numerals
OrderedDict
collections.OrderedDict
keys
collections
while
2
Using translate()
Morse Encoder
translate
dict-comp
items
replace
lower
Using OrderedDict, for, if, else
Reverse Roman Numerals
OrderedDict
collections.OrderedDict
get
collections
range
area = length * height
Largest Rectangle in a Histogram
min
max
append
range
list
First
The Most Numbers
isinstance
tuple
inline-if
sorted
list-comp
1
Alice In Wonderland
Using ipaddress
IP Network: Route Summarization
ip_address
ipaddress.ip_address
ipaddress
itertools.takewhile
takewhile
8
2
3 Solutions: 1. using numpy, 2. using zip(), 3. using list comprehension
Transposed Matrix
numpy.transpose
transpose
numpy
as
List
9
2
Using recursion
Tree Walker
isinstance
values
dict
sum
list
17
1
Using bin() and eval() functions
Multiplication Table
eval
f-string
bin
int
for
2
Using index() and max() with key
The Fastest Horse
index
min
max
count
print
2
One-liner using slice()
Middle Characters
len
2
Using datetime, strptime(), weekday()
When is Friday?
datetime.strptime
strptime
datetime.datetime
datetime
inline-if
2
Using range() and list comprehension
Zigzag Array
List
typing.List
index
typing
inline-if
2
Using collection module, Counter class, itertools module, combinations class
Long Non Repeat
combinations
itertools.combinations
collections.Counter
Counter
itertools
2
Using pairwise Class and chain Class from itertools module
Swap Nodes
itertools.pairwise
pairwise
from_iterable
itertools.from_iterable
chain
GitHub
Using regex
Simplify Unix Path
re.sub
sub
r-string
re
print
9
1
3 Solutions using math.gcd(), numpy.diff(), itertools.pairwise()
Evenly Spaced Trees
diff
numpy.diff
itertools.pairwise
pairwise
math.gcd
9
Using datetime.date()
The Most Frequent Weekdays
date
datetime.date
datetime
set
sorted
14
5
Using brute force
Long Repeat Inside
dict-comp
items
break
lambda
count
17
2
Using Algorithm to find the area of a polygon
Area of a Convex Polygon
abs
len
for
20
2
Using range()
Expand Intervals
extend
typing.Iterable
Iterable
typing
range
Using numpy, sum(), argmax()
The Highest Building
argmax
numpy.argmax
numpy.sum
numpy
as
Using regex
The End of Other
re.search
search
re
lambda
sorted
2
if...else FTW
Merge Intervals
pop
or
print
append
else
Using regex
Cookies
re.compile
compile
re
Using a Class for compare operators
Solution for Anything
class
True
Using if and for
Create Intervals
sort
or
elif
append
range
Dropbox
Regex FTW (13 functions)
Calculator-III
eval
re.sub
sub
findall
re.findall
1
Regex For The Win!
Calculator-IV
Decimal
decimal.Decimal
decimal
eval
rstrip
1
Using numpy array
Scytale Encryption
textwrap.wrap
wrap
textwrap
Optional
typing.Optional
1
Used 4 functions to solve it
Sort Sorted Groups
f-string
break
print
sorted
elif
2
Too many re (with comments and prints)
Calculator-II
rfind
startswith
re.split
eval
isnumeric
2
Lots of elif with print and comments
Calculator-I
rfind
startswith
re.split
eval
isnumeric
7
2
Using numpy
Rotating Grille Cipher
ma
numpy.ma
count_nonzero
numpy.count_nonzero
numpy.rot90
8
Second - Regex FTW
Calculator-II
AttributeError
eval
re.sub
sub
findall
9
Using zip() and index()
Common Tail
zip
index
None
except
try
10
Brute-force, with explanations
e+pi
math.isclose
isclose
OverflowError
math.e
e
11
1
Using find() and index
Atbash Cipher
find
else
str
for
if
12
2
Solution using if, else and for
The Longest Word
print
split
else
str
len
14
Recursion FTW
Sum of Distinct Cubes
None
or
print
sorted
True
15
Using itertools module
All Permutations
collections.abc.Iterable
itertools.permutations
permutations
itertools
collections
16
First
Revorse the vewels
f-string
islower
upper
pop
lower
16
Second - Shorter than First
Calculator-I
AttributeError
eval
re.sub
sub
f-string
Using hashlib module - one-liner solution
Simple Hashlib
hashlib.new
new
hashlib
2
Solution using regex
The Longest Word
findall
re.findall
r-string
re
max
1
My number is the best because is the ACE
The Best Number Ever
print
int
Using pi, sqrt, asin, atanh from math module
Humpty Dumpty Form
math.atanh
atanh
math.asin
asin
math.pi
Finding factors in decreasing order
Numbers Factory
math.prod
prod
math
or
sorted
Using max with key
Worth of Words
get
dict
max
sum
list-comp
Using combinations and sorted() after len
The Longest Palindromic
combinations
itertools.combinations
itertools
sorted
True
2 Solutions: 1. using num2words (not allowed, here) 2. a longer one
Speech Module
replace
join
elif
append
if
Using Decimal class from decimal module
Friendly Number
Decimal
decimal.Decimal
decimal
format
round
PyCon TW
Using regex and max() with key
Double Substring
re.compile
compile
r-string
re
max
13
4
Using fractions module and Fraction class
How Much Gold
items
print
in
else
for
14
One-liner using groupby() class from itertools module
Sum Consecutives
groupby
itertools.groupby
itertools
sum
list-comp
2
Using math, pi and Heron's formula
Simple Areas
math.pi
pi
math
print
elif
2
Second
Digit Stack
map
pop
sum
in
and
2
Converting TABLE to a dictionary
Ryerson Letter Grade
dict-comp
items
in
split
range
1
Using sorted()
Robot Sort
sorted
join
while
append
range
1
Using if
Digit Stack
map
pop
sum
in
append
2
2 Solution: using regex
House Password
findall
re.findall
re
bool
False
Storage
Long, with explanations
List Beautify
f-string
zip
map
print
sorted
5
Using numpy, sum(), argmin()
Weak Point
argmin
numpy.argmin
numpy.array
array
numpy
Using regex
Word Pattern
re.sub
sub
bin
re
print
1
Using numpy and transpose()
Skew-symmetric Matrix
numpy.array
array
numpy
as
all
One-liner using itertools module and groupby class
Group Equal consecutive
groupby
itertools.groupby
itertools
list-comp
list
2 Solutions: 1. while + if 2. List comprehensions
Saw the Stick
max
inline-if
print
while
if-comprehension
HubSpot
Very long solution, but with explanations
Triangular Islands
issuperset
typing.Set
Set
isdisjoint
fromkeys
2
Using strip() and split()
Non Empty Lines
strip
print
if-comprehension
list-comp
split
2
Using datetime and calendar modules
Weekly Calendar
Calendar
calendar.Calendar
calendar
date
datetime.date
Using dictionary comprehension for every side
Square Board
Tuple
typing.Tuple
f-string
dict-comp
get
Using the positions of the remainders in repeating decimals string
Repeating Decimals
None
print
while
and
else
Using try except
Number Base
ValueError
except
try
int
3
Using pop()
Restricted Sum
pop
not
else
if
2
Using string module
Number Base
digits
string.digits
ascii_uppercase
string.ascii_uppercase
string
1
Blizzard
One-liner using Permutation class from sympy.combinatorics.permutations
Permutation Index
sympy.combinatorics.permutations.Permuta
Permutation
sympy
Tuple
typing.Tuple
1
Using distance_matrix and minimum_spanning_tree from scipy (with explanations)
Connect Stars
distance_matrix
scipy.spatial.distance_matrix
scipy.sparse.csgraph.minimum_spanning_tr
minimum_spanning_tree
numpy.argwhere
3
2
Longest solution (13 functions) + Explanations
Sudoku Solver
numpy.where
where
numpy.array
array
numpy
4
Adding all rectangles with dimension 1x1 in a set
Rectangles Union
Tuple
typing.Tuple
add
List
typing.List
7
Using 't\' and '\t'
Palindromic Palindrome
lambda
Using timedelta class, weekday()
Weekend Counter
datetime.timedelta
timedelta
datetime
if-comprehension
in
Using math module and divmod() function
Reversed Permutation Index
math.factorial
factorial
divmod
tuple
remove
Using datetime module, datetime class and timedelta class
The First Working Day
datetime.strptime
strptime
datetime.timedelta
timedelta
datetime.datetime
First
Stair Steps
max
print
for
Using regex
Stressful Subject
re.compile
compile
isupper
re
lower
Using datetime
Unlucky Days
datetime.datetime
datetime
print
range
int
Using sorted() with key
Min and Max
iter
get
None
inline-if
sorted
2
Using math
The Angles of a Triangle
math.acos
acos
math.pi
pi
round
1
Rock
Complicated + 1 wrong result = unfinished
Greedy Number
f-string
map
enumerate
break
lambda
2
1
Combinations
Garland
combinations
itertools.combinations
set-comp
f-string
itertools
18
Using new list creation
Sort by Removing
IndexError
except
try
print
append
First
Super Root
abs
print
while
Shelter
Using recursion and the all() function
Completely Empty
all
except
try
False
list-comp
Using brute force (list with all opacities) + explanations
Ghosts Age
math.sqrt
sqrt
math
index
or
2
First
Pattern Recognition
map
lambda
print
append
range
Using math and floor() and ceil()
The Nearest Square Number
math.floor
floor
math.ceil
ceil
math.sqrt
Codeship
Using while
Champernowne Word
print
while
int
str
len
Long solution, using 3 functions + comments
Rolling 🎲!
print
elif
int
str
for
All possible squares
The Square Chest
f-string
all
List
typing.List
None
Hermit
Using math, acos(), pi
Strawberry Fields
math.acos
acos
math.pi
pi
round
7
1
Using math module + gcd() and lcm() functions
Fractions Addition
math.lcm
lcm
math.gcd
gcd
f-string
8
Using sympy module and sympify() function
Simplification
sympify
sympy.sympify
sympy
replace
str
8
2
Using numpy and 5 separated methods
Mono Captcha
count_nonzero
numpy.count_nonzero
numpy.array
array
numpy
18
Using datetime.date.weekday() and datetime.timedelta()
Birthday Party
datetime.timedelta
timedelta
date
datetime.date
datetime
Using regex
Backspace Apply
re.search
search
tuple
re
None
Using enumerate()
Excel Column Number
ascii_uppercase
string.ascii_uppercase
dict-comp
string
get
Second - using regex
Backspace Apply
re.search
search
re
None
print
Using re.sub() and split()
Unique Email Addresses
re.sub
sub
re
set
lower
Using slice()
Shorter Set
set
print
sorted
list
int
2
Using product and map
Break Rings
itertools.product
product
itertools
map
min
2
Using itertools.combinations()
Stock Profit
combinations
itertools.combinations
itertools
max
inline-if
First
The Good Radix
ascii_uppercase
string.ascii_uppercase
re.compile
compile
string
Brute-force (not optimized) using itertools (tee(), islice())
Count Consecutive Summers
itertools.tee
tee
islice
itertools.islice
next
Watchtower
Too long (7 functions)
Vigenere Cipher
numpy.where
where
numpy.array
array
ascii_uppercase
2
15th - For using the 'cycle' keyword
Funny Addition
cycle
itertools.cycle
itertools
for
if
15
16th - For using StringIO keyword
Funny Addition
StringIO
io
io.StringIO
int
str
Using list comprehensions + comments
Rotate Hole
enumerate
set
if-comprehension
list-comp
range
11th - using callable()
Funny Addition
callable
Enum
enum.Enum
enum
class
2
4th - using isdisjoint()
Funny Addition
isdisjoint
set-comp
pass
sum
comprehension
Using 2 "for" loops
Number Guess
discard
f-string
min
set
print
Using functools.reduce()
Funny Addition
Exception
raise
functools.reduce
reduce
functools
2
Using enum.Enum
Funny Addition
Enum
enum.Enum
enum
class
print
1
Using set
Funny Addition
set-comp
sum
comprehension
else
len
6th - using functools.partial()
Funny Addition
functools.partial
partial
functools
add
7th - using heapq
Funny Addition
heapq.nsmallest
nsmallest
heapq.nlargest
nlargest
heapify
8th - using iter() and StopIteration
Funny Addition
StopIteration
iter
except
try
print
9th - using dict.fromkeys()
Funny Addition
fromkeys
keys
dict
else
for
10th - using issubclass() for level
Funny Addition
issubclass
Enum
enum.Enum
enum
class
12th - Using string.Template class and eval()
Funny Addition
Template
string.Template
eval
string
5th - using issuperset()
Funny Addition
issuperset
set-comp
sum
comprehension
else
13th - using <finally> for the Quest
Funny Addition
finally
f-string
except
try
print
14th - using 'with', for the quest
Funny Addition
contextlib.suppress
suppress
contextlib
with
ValueError
Escher
Using brute force
Hypercube
numpy.where
where
isdisjoint
numpy.array
array
4
Using eval()
Safe Code
startswith
eval
continue
replace
or
6
Very long, could be optimized
Treasures
f-string
values
get
round
print
6
Almost OK
Card Game
max
count
sorted
elif
False
6
Using dictionary
The Secret Room
dict-comp
keys
dict
items
index
11
Using numpy
Keys and Locks
numpy.array_equal
array_equal
numpy.rot90
rot90
numpy.array
Using match...case
Compass, Map and Spyglass
case
match-case
abs
max
print
List Comprehension
The Ship Teams
items
or
sorted
if-comprehension
list-comp
Using re and dictionary comprehension
The Stone Wall
finditer
re.finditer
splitlines
dict-comp
keys
Calculating area
Ground for the House
rfind
find
max
inline-if
print
Not On Map
Using dictionary and list comprehension
Most Wanted Letter
values
dict-comp
items
isalpha
max
4
2
Using len()
Length of the String
print
int
str
len
11
2
For, if, else
Aggregate and Count
dict
print
list
else
for
2