From bb5a25946ea31a8d2a109f2516a1ddc45c62ceef Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sat, 16 Apr 2011 01:01:06 +0300 Subject: fixed drop row logic --- 2010/1a/a.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to '2010/1a/a.py') diff --git a/2010/1a/a.py b/2010/1a/a.py index e96a53e..c3f6aab 100644 --- a/2010/1a/a.py +++ b/2010/1a/a.py @@ -8,11 +8,7 @@ def rotate(m): # drop a single row def droprow(r): - n = len(r) - for i in range(n)[::-1]: - if r[i] != '.': - return r[i+1:]+r[:i+1] - return r + return '.' * r.count('.') + r.replace('.','') # drop the rotated matrix def gravity(m): -- cgit v1.3.1