21
slchangtw
4 20 35
2419/ 2695
Shun-Lung Chang
Last seen 8 months ago
Member for 4 years, 13 days
Difficulty Normal
Missions (174) / Solutions (158)
Best solutions / Newest solutions
Initiation
First
First Word (simplified)
split
str
First
Correct Sentence
endswith
upper
inline-if
str
First
Nearest Value
enumerate
min
abs
set
if-comprehension
First
Count Digits
isdigit
sum
list-comp
comprehension
int
Solution
The Most Frequent
collections.Counter
Counter
collections
list
str
First
Easy Unpack
tuple
1
First
Replace First
pop
typing.Iterable
Iterable
typing
inline-if
First
Between Markers (simplified)
find
str
1
First
Number Length
int
str
len
First
Sum Numbers
isdigit
sum
if-comprehension
list-comp
split
First
Split Pairs
list-comp
range
comprehension
len
if
1
First
Beginning Zeros
re.split
re
split
int
str
First
Remove All Before
index
typing.Iterable
Iterable
typing
in
1
First
Is Even
bool
int
1
First
All the Same
Any
typing.Any
all
List
typing.List
1
First
All Upper I
all
isupper
isdigit
bool
or
First
End Zeros
reversed
break
else
int
str
2
First
Backward String
reversed
join
str
1
First
Max Digit
max
list-comp
comprehension
int
str
1
First
Acceptable Password I
bool
str
len
First
Multiply (Intro)
1
Home
itertools.chain.from_iterable
Duplicate Zeros
chain
itertools.chain
itertools
inline-if
print
Solution
Date and Time Converter
f-string
re.search
search
re
inline-if
First
First Word
re.search
search
re
str
First
Second Index
finditer
re.finditer
re
None
inline-if
solution
Morse Decoder
capitalize
replace
join
split
comprehension
First
Days Between
datetime.datetime
datetime
abs
First
Even the Last
inline-if
sum
list
int
First
Bigger Price
lambda
sorted
list
int
1
First
Popular Words
dict-comp
dict
lower
count
split
First
Between Markers
find
inline-if
in
str
len
First
Sort Array by Element Frequency
collections.Counter
Counter
collections
index
lambda
First
Split List
math.ceil
ceil
math
list
len
Solution
Sun Angle
typing.Union
Union
round
typing
inline-if
First
Right to Left
tuple
replace
join
list-comp
comprehension
First
Non-unique Elements
count
if-comprehension
list-comp
list
comprehension
First
Three Words
isdigit
bool
elif
False
True
Electronic Station
numpy.diag + itertools.groupby
Find Sequence
groupby
itertools.groupby
numpy.array
array
numpy
4
First
Acceptable Password II
any
isdigit
bool
and
comprehension
14
Check if the quotients of three sides are all the same
Similar Triangles
numpy.linalg
linalg
numpy.array
array
combinations
Solution
Acceptable Password IV
all
any
isdigit
False
and
1
First
Words Order
bool
set
if-comprehension
in
False
Regex shortcut
Unix Match. Part 1
rf-string
f-string
re.search
search
re
Solution
Acceptable Password VI
all
any
isdigit
bool
set
Solution
Acceptable Password V
all
any
isdigit
bool
not
By bitwise operators
Boolean Algebra
inline-if
print
elif
else
if
1
First
Surjection Strings
find
map
bool
list
str
First
Acceptable Password III
all
any
isdigit
bool
not
Solution
All Upper II
all
isupper
isalpha
bool
not
1
stack
Brackets
values
dict
zip
pop
bool
First
Digits Multiplication
functools.reduce
reduce
functools
lambda
if-comprehension
1
Scientific Expedition
sorted and groupby
Convert and Aggregate
groupby
itertools.groupby
update
dict
itertools
11
1
Dict comprehension
YAML. Simple Dict
isdecimal
dict-comp
inline-if
if-comprehension
list-comp
12
Solution
Follow Instructions
Tuple
typing.Tuple
typing
count
int
Solution
Caps Lock
upper
enumerate
inline-if
join
list-comp
Solution
Pangram
ascii_lowercase
string.ascii_lowercase
string
isalpha
set
1
First
Time Converter (24h to 12h)
f-string
inline-if
split
int
if
Solution by Counter
The Most Wanted Letter
collections.Counter
Counter
collections
isalpha
lower
1
Solution
Common Words
set
sorted
join
split
list
By zip_longest
The Hidden Word
itertools.zip_longest
zip_longest
itertools
find
enumerate
Solution
Sum by Type
Tuple
typing.Tuple
isinstance
typing
list
Solution
Conversion into CamelCase
title
join
list-comp
split
comprehension
Solution
Conversion from CamelCase
re.sub
sub
r-string
re
lower
By string
Letter Queue
List
typing.List
typing
split
else
I love Python!
I Love Python!
Solution
Striped Words
re.sub
sub
strip
all
isalpha
Solution
Bird Language
re.sub
sub
r-string
re
str
Solution
Secret Message
isupper
join
if-comprehension
list-comp
comprehension
O'Reilly
sort(), pop() and append()
The Final Stone
sort
pop
abs
inline-if
print
Simple if and while
Sum of Digits
break
sum
print
while
list-comp
Based conversion + palindrome check
Integer Palindrome
bool
print
while
False
append
filter times that are greater than start_watching
Lightbulb Start Watching
Optional
typing.Optional
insert
datetime.datetime
datetime
1
Solution
Reverse Every Ascending
range
len
for
if
1
Solution by index
Remove All After
index
typing.Iterable
Iterable
typing
in
Simple
Lightbulb End Watching
datetime.max
datetime.datetime
datetime
zip
min
Zip even and odd elements
Lightbulb Intro
datetime.datetime
datetime
List
typing.List
zip
1
By range(step)
Chunk
typing.Iterable
Iterable
typing
list-comp
range
Recursion
The Flat Dictionary
isinstance
dict
items
not
elif
Slice the list smartly
Median of Three
statistics.median
statistics
median
typing.Iterable
Iterable
Enumerate
Compress List
enumerate
typing.Iterable
Iterable
typing
or
Counter
Frequency Sorting
collections.Counter
Counter
collections
List
typing.List
Recursion
Flatten a List
isinstance
list
else
len
if
1
Solution
Sort Except Zero
enumerate
typing.Iterable
Iterable
typing
sorted
Use zip and * to perform transpose
Xs and Os Referee
List
typing.List
zip
typing.Iterable
None
Solution by sorted
Median
float
List
typing.List
typing
sorted
Incinerator
Make a dummy method in Warrior and implement it in Healer
The Healers
class
property
super
decorator
extend
1
Solution
Building Base
class
raise
isinstance
f-string
ValueError
1
classmethod
Geometry Figures
classmethod
class
math.pi
pi
decorator
Clear
Army Units
ABC
abc.ABC
abc.abstractmethod
abstractmethod
abc
Clear
Capital City
class
object
is
None
str
By List of Warriors
The Lancers
class
property
super
decorator
extend
Clear
Dialogues
class
f-string
find
None
lower
Clear
Voice TV Control
class
typing.Union
Union
isinstance
List
Clear
3 Chefs
class
super
f-string
int
str
hasattr
The Vampires
class
getattr
hasattr
raise
property
Refactor
The Vampires
class
property
super
decorator
extend
getattr
The Defenders
class
getattr
raise
property
super
Pop
Army Battles
class
raise
property
super
decorator
Property and while
The Warriors
class
property
super
decorator
not
Mine
Check by removing repeated letters
Long Pressed
re.sub
sub
r-string
re
bool
operator.itemgetter
Best Stock
itemgetter
operator.itemgetter
operator
dict
items
defaultdict and eval
Aggregate by Operation
ZeroDivisionError
eval
collections.defaultdict
defaultdict
f-string
By stack
Adjacent Letters
pop
print
join
and
append
Clear
Cut Sentence
range
int
str
len
for
Life is short, let's focus more on problems that haven't been solved :)
Determinant
numpy.linalg
linalg
numpy
as
round
Life is short, let's focus more on problems that haven't been solved by a great 3rd party package :)
Determinant
numpy.linalg
linalg
numpy
as
round
str.count("1")
Binary Count
bin
count
int
math.gcd and functools.reduce
The Greatest Common Divisor
math.gcd
gcd
functools.reduce
reduce
functools
ord and chr
Caesar Cipher (encryptor)
chr
ord
isalpha
inline-if
join
First
Fizz Buzz
print
elif
and
else
int
2
Clear
Moore Neighbourhood
Tuple
typing.Tuple
List
typing.List
min
Ice Base
Pointer
Move Zeros
print
range
list
int
len
Simple solution
Is String a Number? (Part II)
startswith
all
replace
isdigit
bool
1
Simple
Correct Capital
capitalize
islower
all
isupper
bool
Clear
Feed Pigeons
inline-if
while
1
List comprehension
Morse Encoder
lower
join
list-comp
comprehension
3
regex
Long Repeat
finditer
re.finditer
r-string
re
max
Regex
Find Quotes
findall
re.findall
re
in and lower()
Monkey Typing
set
lower
sum
in
list-comp
Tuples, modulo operation, and continue
Roman Numerals
continue
else
for
if
1
By mappings and str.replace()
Reverse Roman Numerals
items
replace
sum
comprehension
int
Divide and conquer
Largest Rectangle in a Histogram
List
typing.List
max
typing
range
Simple
The Most Numbers
min
max
else
len
if
1
Alice In Wonderland
By modulo operation
When is Friday?
datetime.strptime
strptime
datetime.datetime
datetime
print
Swap with exception handling
Swap Nodes
pass
except
try
range
len
isslice
Zigzag Array
islice
itertools.islice
iter
itertools
sort
Simple
Middle Characters
else
str
len
if
GitHub
With comments
Evenly Spaced Trees
math.gcd
gcd
math
min
max
One-liner code
Cookies
dict
list-comp
split
comprehension
str
Using set() to add new numbers
Expand Intervals
set-comp
typing.Iterable
Iterable
set
typing
sorted and pop
The End of Other
Exception
endswith
pass
any
pop
Dropbox
First
Speech Module
zfill
f-string
strip
inline-if
print
PyCon TW
Naive way
Ryerson Letter Grade
elif
else
int
str
if
1
groupby
Sum Consecutives
groupby
itertools.groupby
itertools
List
typing.List
bubble_sort
Robot Sort
f-string
tuple
join
append
range
Bubble sort
Robot Sort
f-string
tuple
join
append
range
Backreference
Double Substring
findall
re.findall
r-string
re
max
1
unpack args
Simple Areas
math.pi
pi
round
math
elif
Straightforward
House Password
islower
any
isupper
isdigit
bool
Storage
np.array_equal(m, -m.T)
Skew-symmetric Matrix
numpy.array_equal
array_equal
numpy.array
array
numpy
"Quasi" one-line
Word Pattern
zfill
bin
isalpha
bool
inline-if
HubSpot
datetime
Weekly Calendar
datetime.timedelta
timedelta
date
datetime.date
datetime
Replaced the birthdays by the current year (or current year + 1)
Next Birthday
finally
update
date
datetime.date
ValueError
First
Square Board
extend
tuple
list-comp
range
comprehension
1
split, len() > 0 and not str.isspace()
Non Empty Lines
isspace
not
sum
print
if-comprehension
int(number, base) and exception handling
Number Base
ValueError
except
try
int
str
Blizzard
np.busday_count()
Weekend Counter
busday_count
numpy.busday_count
datetime.timedelta
timedelta
numpy
10
Clear
Reversed Permutation Index
math.factorial
factorial
math
pop
typing.Iterable
index and factorial
Permutation Index
math.factorial
factorial
tuple
math
pop
1
datetime.weekday()
Unlucky Days
datetime.datetime
datetime
range
int
for
Simple one line
Unlucky Days
datetime.datetime
datetime
sum
range
comprehension
Rock
By stack
Sort by Removing
continue
and
append
list
for
Escher
Sum, comparison and list comp.
The Secret Room
divmod
extend
None
sum
join
Simple
The Stone Wall
strip
zip
index
min
sum
Simple
Ground for the House
rindex
strip
enumerate
index
min
Simple
Compass, Map and Spyglass
tuple
zip
enumerate
index
None
Simple
The Ship Teams
dict
items
sort
or
append