We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 41e138e commit bce0e50Copy full SHA for bce0e50
processing-form.py
@@ -0,0 +1,31 @@
1
+from typing import (
2
+ List,
3
+)
4
+
5
+class Solution:
6
+ """
7
+ @param a: the csv file a
8
+ @return: return the processed file
9
10
+ def processing_file(self, a: List[str]) -> List[str]:
11
+ # Write your code here
12
+ ret = []
13
+ rows = len(a)
14
+ ls = []
15
+ for i in range(rows):
16
+ words = a[i].split(',')
17
+ for i in range(len(words)):
18
+ if i >= len(ls):
19
+ ls.append(len(words[i]))
20
+ if len(words[i]) > ls[i]:
21
+ ls[i] = len(words[i])
22
23
+ s = []
24
25
26
+ w = words[i]
27
+ s.append(' ' * (ls[i] - len(w)) + w)
28
+ ret.append(','.join(s))
29
+ return ret
30
31
+# medium: https://www.lintcode.com/problem/1618/
0 commit comments