Write Up Code Wars —
Permutations Solutions Python

Code Wars is best platform for learning algorithm from programming language, here I want to write the solution for ‘Permutations’ challenge using Python. When it was written, the challenge is in kyu 4.

The Description

In this kata you have to create all permutations of an input string and remove duplicates, if present. This means, you have to shuffle all letters from the input in all possible orders.

Examples:

permutations('a'); # ['a']
permutations('ab'); # ['ab', 'ba']
permutations('aabb'); # ['aabb', 'abab', 'abba', 'baab', 'baba', 'bbaa']

The order of the permutations doesn’t matter.

The Answer

I’m really sorry for this, but I want to say, I don’t really get the answer by myself. My answer is here

My answer is based on Peter Liang solutions, after I trying to understand, the answer is based on multiple iterations inside the code. After I solve the answer, I got more great answer like this from rffrancon, sicknick323, temp lolololol

Also from Sebek, maxx_d2

I write this article because I want to share to the others how to solve this, this might be not true because I use another warrior answer. But I’m sorry for this, I will try my best next time. Thanks for reading.

--

--

--

A Stoic Developer || Junior Data Engineer || Dreamer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Learning iOS from Android perspective

Senior algorithm developer

FastAPI, Deta, and YCombinator

TypeScript, from skeptic to convert

Azure Load Testing: New Service by Microsoft

Azure Load Testing: New Service by Microsoft

Set up a Substrate RPC node

Linux 101 for SQL Server DBAs, Part II

Creating Fillable PDF Form Fields in Java Application

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Handhika Yanuar Pratama

Handhika Yanuar Pratama

A Stoic Developer || Junior Data Engineer || Dreamer

More from Medium

C Language “hello world” Program Explained Step by Step All Statements

Journey on My First Web Application for Geoscience. Things I Learned So Far (Part-1)

Web Scraping Indonesia Volcano Status on Vsi.esdm.go.id

Setting up my first “FLASK” project