26
bsquare
16 37 52 Leader of the month
3764/ 3945
Last seen 10 days ago
Member for 4 years, 9 months, 21 days
Difficulty Advanced
Software Architect - Artificial Intelligence R&D Engineer

Missions (153) / Solutions (93)
Best solutions / Newest solutions
Initiation
Quick and easy
All the Same
set
len
4
3-chars solution :)
Multiply (Intro)
mul
operator.mul
operator
8
3
Flatten generator
Flatten a List
collections.abc.Iterable
yield
isinstance
collections
Iterable
9
1
zip_longest trick
Split Pairs
itertools.zip_longest
zip_longest
f-string
itertools
list-comp
2
Complete clear and documented solution with numpy
Pawn Brotherhood
numpy.bool
numpy.argwhere
argwhere
numpy.array_equal
array_equal
1
Clean solution with dictionary, groupby, sorted with key
Sort Array by Element Frequency
groupby
itertools.groupby
add
itertools
index
Clean and easy solution with regex
Time Converter (12h to 24h)
match
re.match
f-string
r-string
re
A safe-guard is often nice
Between Markers
escape
re.escape
re.sub
sub
r-string
Solution with List comprehension
Non-unique Elements
count
if-comprehension
list-comp
list
comprehension
2
Home
Quick solution (map and f-string)
Time Converter (24h to 12h)
f-string
map
split
int
1
2
Nice numpy solution checking properly rows, columns, diagonal and anti-diagonal
Xs and Os Referee
fliplr
numpy.fliplr
numpy.where
where
numpy.array
1
2
Clean and clear
Sun Angle
map
or
inline-if
split
int
2
Clear and documented solution with regular expressions with group replacing
Bird Language
re.sub
sub
r-string
re
Walrus and Negative floor division tricks
Split List
list
len
Simplified stack solution
Brackets
values
pop
None
in
elif
8
Electronic Station
Nice and documented solution with numpy
Can You Pass?
numpy.array_equal
array_equal
numpy.array
array
numpy
3
2
Clear solution with itertools product and generator
Mathematically Lucky Tickets
operator.truediv
truediv
operator.sub
operator.add
ZeroDivisionError
Proper solution with numpy, generator and slicing
Find Sequence
ndarray
numpy.ndarray
numpy.unique
unique
fliplr
Regular expression, translate, translation map
Unix Match. Part 1
translate
re.compile
compile
re
None
2-lines solution with reduce
Digits Multiplication
functools.reduce
reduce
functools
replace
lambda
Scientific Expedition
One-line solution with lambda and regex
Secret Message
re.sub
sub
r-string
re
lambda
9
2-lines solution, with walrus and lambda tricks
YAML. More Types
isnumeric
strip
dict-comp
None
replace
Clear solution with numpy
Cipher Map
numpy.rot90
rot90
numpy.array
array
numpy
One-line solution, with walrus trick
YAML. Simple Dict
isnumeric
strip
dict-comp
inline-if
if-comprehension
Clear solution with defaultdict, sum and floor div trick
Call to Home
collections.defaultdict
defaultdict
values
collections
min
1
One-line solution (sorted with key)
Absolute Sorting
abs
sorted
1
O'Reilly
One line solution
Index Power
inline-if
len
1
Just using several ways to re-order list
Reverse Every Ascending
reverse
reversed
extend
is
None
Simple EAFP solution
Sort Except Zero
insert
ValueError
pass
typing.Iterable
Iterable
Incinerator
Clean OOP Solution with full inheritance
The Warlords
class
math.floor
floor
property
super
1
21
Final optimized OOP Solution (iteratively improved among all challenges of the saga)
The Warlords
class
clear
staticmethod
collections.deque
deque
3
1
Clear OOP Solution (ready for next challenges of the saga)
The Vampires
class
staticmethod
collections.deque
deque
property
4
5
Overkill solution with some builtin functions (starmap, zip ...)
Microwave Ovens
dataclasses.field
field
dataclass
dataclasses
dataclasses.dataclass
7
1
Easy and clearly documented solution
Building Base
class
f-string
20
Full clean OOP Solution, and f-string with thousand separator, and datetime
Every Person is Unique
class
datetime.strptime
strptime
f-string
datetime.datetime
Clear OOP Solution (ready for next challenges of the saga)
The Defenders
class
staticmethod
collections.deque
deque
property
1
Complete solution without obfuscation and some overkill safe-guards :)
Microwave Ovens
dataclasses.field
field
dataclass
dataclasses
dataclasses.dataclass
Clear OOP Solution (ready for next challenges of the saga)
The Weapons
class
staticmethod
collections.deque
deque
property
1
Clear OOP Solution (ready for next challenges of the saga)
Straight Fight
class
staticmethod
collections.deque
deque
property
1
Clear OOP Solution (ready for next challenges of the saga)
Army Battles
class
staticmethod
collections.deque
deque
property
1
Full OOP with Friends AND Connection classes, with __hash__, __eq__, and __str__ methods.
Friends
hash
class
property
set-comp
decorator
1
Clear OOP Solution (ready for next challenges of the saga)
The Healers
class
staticmethod
collections.deque
deque
property
1
Clear OOP Solution (ready for next challenges of the saga)
The Lancers
class
staticmethod
collections.deque
deque
property
1
Simple test on new checkio validation tests
The Warlords
class
StopIteration
clear
staticmethod
collections.deque
1
Clear OOP Solution (ready for next challenges of the saga)
The Warriors
class
property
super
decorator
f-string
9
Simple test on new checkio validation tests
The Warriors
class
property
super
decorator
f-string
1
Mine
One line solution
Caesar Cipher (encryptor)
string.index
ascii_lowercase
string.ascii_lowercase
as
string
Clear one-line solution
Achilles and the Tortoise
2
One-line solution (sorted with key)
Best Stock
items
lambda
sorted
Ice Base
Clear and quick
Long Repeat
groupby
itertools.groupby
itertools
max
list-comp
5
2
Quick one-line solution
Morse Encoder
get
lower
join
comprehension
7
1
Elegant OOP Solution (ready for the 3 Sendgrid Challenges)
City's Happiness
class
frozenset
super
set-comp
f-string
9
4
Elegant OOP Solution (ready for the 3 Sendgrid Challenges)
Node Disconnected Users
class
frozenset
super
set-comp
f-string
1
Elegant OOP Solution (ready for the 3 Sendgrid Challenges)
New Cities
class
frozenset
super
set-comp
f-string
Full OOP Solution
How to Find Friends
hash
class
property
set-comp
decorator
Alice In Wonderland
Why do it simple when we can do it more complex?
Easy Unpack
tuple
list-comp
comprehension
8
2
2-lines solution with map and f-string
Date and Time Converter
calendar.month_name
month_name
calendar
findall
re.findall
2
Very Clear (but not the more efficient)
Long Non Repeat
break
max
in
list-comp
range
1
Clear solution with defaultdict
The Fastest Horse
collections.defaultdict
defaultdict
items
collections
index
Simple and quick with regexp
Correct Sentence
re.sub
sub
r-string
upper
re
1
4 lines solution using Dictionary Comprehension, and multiple sorted
The Most Wanted Letter
itemgetter
operator.itemgetter
operator
filter
dict-comp
3
One-line solution (sorted with key)
Bigger Price
lambda
sorted
1
One-line solution with datetime (no format)
Days Between
datetime.datetime
datetime
abs
1
GitHub
Use 'create interval' solution on all numbers.
Merge Intervals
extend
zip
set
sorted
if-comprehension
3
1
Clean solution using datetime and timedelta with *args, **kwargs and map tricks
Broken Clock
datetime.timedelta
timedelta
datetime.datetime
datetime
map
4
7
Solution playing with sets
Power Supply
difference
union
intersection
set-comp
set
7
Simple 2-lines solution with numpy
Area of a Convex Polygon
hstack
numpy.hstack
numpy.roll
roll
numpy
15
Nice clear solution
Long Repeat Inside
in
range
len
for
if
1
One line solution with itertools
Expand Intervals
chain
itertools.chain
itertools
typing.Iterable
Iterable
Dropbox
Mostly built-in functions
Text Formatting
center
textwrap.wrap
wrap
textwrap
ljust
8
Clear one-line solution
Popular Words
findall
re.findall
dict-comp
r-string
re
1
One-line solution with regular expression
Popular Words
findall
re.findall
dict-comp
r-string
re
Clear and documented solution with operator and f-string
Friendly Number
floordiv
operator.floordiv
operator.truediv
truediv
operator
Clear and documented solution.
Numbers Factory
map
not
inline-if
sorted
join
1
One-line solution with lambda and regex
Three Words
re.search
search
r-string
re
None
Nice clear solution
The Longest Palindromic
range
len
for
if
1
Exponential
The Best Number Ever
1
Nice solution with walrus and try/except
Simple Hashlib
bytes
AttributeError
hashlib.new
new
hashlib
PyCon TW
Clean and documented solution with numpy
Calculate Islands
numpy.argwhere
argwhere
numpy.array_equal
array_equal
numpy.array
Brute-force Solution with combinations
Double Substring
combinations
itertools.combinations
dict-comp
keys
any
Storage
Quick one-line solution
Skew-symmetric Matrix
numpy.array_equal
array_equal
numpy.array
array
numpy
3
HubSpot
Simple solution
Stressful Subject
endswith
strip
any
zip
isupper
16
4
Regexp is your friend
Between Markers (simplified)
escape
re.escape
re.sub
sub
r-string
Quick and easy
Even the Last
inline-if
sum
2
Simple with regexp
First Word (simplified)
match
re.match
r-string
re
1
Blizzard
Clean and educational solution
The Angles of a Triangle
raise
math.degrees
degrees
math.acos
acos
Shelter
Solution with Generator
Completely Empty
collections.abc.Iterable
yield
isinstance
is
collections
Watchtower
Nice and documented solution with numpy
Wall Keeper
numpy.put
put
numpy.bool
numpy.argwhere
argwhere
2
3
3-characters quick and easy solution
Funny Addition
sum
1
Escher
Quick solution
The Ship Teams
items
or
sorted
if-comprehension
comprehension
6
Funny solution with matrix and rotate
The Stone Wall
numpy.rot90
rot90
numpy.array
array
numpy
18
Clean solution with numpy and linalg.norm
Compass, Map and Spyglass
numpy.argwhere
argwhere
numpy.linalg
linalg
numpy.array
19
Amusing way to solve this one
Ground for the House
rindex
continue
enumerate
index
min