Skip to content

Commit 8163e59

Browse files
Aadit KamatMadhavBahl
authored andcommitted
Change heading for Day 10 README and remove dailycodebase directory for Day 9 (#113)
* Add @aaditkamat as a contributor * Add Ruby code for Day 1: FizzBuzz problem * Add Ruby code for Day 2: String reverse problem * Update README.md for Day 2 * Modify Ruby code and README * Add condition for nil and wrong type edge cases * Add a seperate Ruby source code file for palindrome * Modify code for reverse.rb * Add seperate palindrome and reverse code sections in README * Update gitignore * Refactor palindrome.rb and rename heading in README * Add solution for Day 3: Hamming Problem * Add condition for strings of unequal lengths * Update README * Change project name and owner in.all-contributorsrc * Remove merge conflict lines * Add @shivank86 as a contributor * Add C++ files for different patterns * Add author and date comments at the top of C++ files * Update README.md * Add solution for Day 6 Problem in Python * Update README * Refactor code files * Modify string representation of output in python files * Add Ruby solutions for Day 6 problem * Update README for Ruby code * Add first version of solutions for Day 7 problem in C++, Java & Ruby * Modify solutions * Update Day 7 README * Remove merge conflicts from CONTRIBUTORS.md * Add back removed lines in CONTRIBUTORS.md * Add code sections contributed by @imkaka to day 6 README * Update README.md * Add C++ solution * Add Day 8 solution in C++ * Add Day 8 solution in Java * Add Day 8 solution in Ruby * Add Day 8 solution in Python * Add credits at the top of the code * Update README * Update C++ implementation * Update Python implementation * Add solution for Day 10: String Permutation Problem in Python Signed-off-by: Aadit Rahul Kamat <aadit.k12@gmail.com> * Update Day 10 README Signed-off-by: Aadit Rahul Kamat <aadit.k12@gmail.com> * Change heading in README and remove empty directory in day 9 Signed-off-by: Aadit Rahul Kamat <aadit.k12@gmail.com> * Update README.md
1 parent 22a18f9 commit 8163e59

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

.all-contributorsrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,4 @@
213213
]
214214
}
215215
]
216-
}
216+
}

day10/README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def printList(string_list):
148148
def main():
149149
print('Enter a string: ')
150150
string = input()
151-
print(f'The permutations of {string} are:')
151+
print('The permutations of {string} are:')
152152
printList(permutations(string))
153153

154154
main()
@@ -302,6 +302,42 @@ int main() {
302302
}
303303
```
304304

305+
## Python Implementation
306+
307+
### [Solution](./Python/permutations.py)
308+
309+
```py
310+
'''
311+
@author: aaditkamat
312+
@date: 02/01/2019
313+
'''
314+
315+
def permutations(string):
316+
if (len(string) <= 1):
317+
return [string]
318+
lst = []
319+
for i in range(len(string)):
320+
substring = ''
321+
for j in range(len(string)):
322+
if j != i:
323+
substring += string[j]
324+
lst.extend(list(set(map(lambda x: string[i] + x, permutations(substring)))))
325+
return lst
326+
327+
328+
def printList(string_list):
329+
for string in string_list:
330+
print(string)
331+
332+
def main():
333+
print('Enter a string: ')
334+
string = input()
335+
print(f'The permutations of {string} are:')
336+
printList(permutations(string))
337+
338+
main()
339+
```
340+
305341
### [Solution by @imkaka](./C++/allPermutation.cpp)
306342

307343
```cpp

day9/dailycodebase

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)