aayushi-droid / Python-Thunder

A curated list of Python applications
MIT License
86 stars 160 forks source link

Single Letter Swaps #345

Closed na-vural closed 3 years ago

na-vural commented 3 years ago

Before jumping into Pr first comment for assign. All Problem from Edabit. Link is mandatory to add

Problem statement: Given an array of strings and an original string, write a function to output an array of boolean values - True if the word can be formed from the original word by swapping two letters only once and False otherwise. Examples:

validate_swaps(["BACDE", "EBCDA", "BCDEA", "ACBED"], "ABCDE")
➞ [True, True, False, False]

# Swap "A" and "B" from "ABCDE" to get "BACDE".
# Swap "A" and "E" from "ABCDE" to get "EBCDA".
# Both "BCDEA" and "ACBED" cannot be formed from "ABCDE" using only a single swap.

validate_swaps(["32145", "12354", "15342", "12543"], "12345")
➞ [True, True, True, True]

validate_swaps(["9786", "9788", "97865", "7689"], "9768")
➞ [True, False, False, False]

Problem Link: https://edabit.com/challenge/di7ZjxgvLgz72PvCS


Before submitting a PR please Check some details. Check Edabit for problem task

This repository is valid for HacktoberFest2020

Read before making PR - How to contribute on Github Good Luck,

na-vural commented 3 years ago

May I solve this, can you assing me :) Thanks.

na-vural commented 3 years ago

I have been ready for the pr @aayushi-droid, could you assing me :)