Created
January 6, 2022 14:15
-
-
Save vivekteega/d52c487c9022384b3066573faef6c2e8 to your computer and use it in GitHub Desktop.
Task for Divyansh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sort out the input list ending with special character according to the following weights if the symbols | |
Weight of the symbols | |
@ - 3 | |
* - 2 | |
# - 1 | |
$ - 0 | |
Input | |
['abc#','def*','ghi@','jkl$','mno:','pqr#'] | |
Output | |
['ghi@','def*','abc#''jkl$','mno:','pqr#'] | |
* Sorting should be done for list sets before and after the : keyword | |
* If a special word repeats, maintain original order |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment