Timeline for Sort a string, sort of
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 12, 2017 at 3:04 | comment | added | Dennis | @Lynn Right, rollang back. Thanks for catching that. | |
| Jan 12, 2017 at 3:04 | history | rollback | Dennis | Rollback to Revision 1 | |
| Jan 12, 2017 at 3:02 | comment | added | lynn | This fails if the string has backslashes in it. | |
| Jan 11, 2017 at 4:45 | comment | added | Dennis | @WheatWizard Good eye. Thanks! | |
| Jan 11, 2017 at 4:45 | comment | added | Dennis | @xnor At the very least, this should be a valid 32-bit Python golf. I tried to get rid off the zip, but I don't think adding 1e9 would have ever occurred to me... Thanks! | |
| Jan 11, 2017 at 4:43 | history | edited | Dennis | CC BY-SA 3.0 | added 156 characters in body |
| Jan 11, 2017 at 4:38 | comment | added | Wheat Wizard♦ | @xnor you can drop the [] and change 18 to 17 to save two bytes. lambda s:`sorted((1e9+s[:i].count(c),c)for i,c in enumerate(s))`[17::21] | |
| Jan 11, 2017 at 4:22 | comment | added | xnor | Don't know if it's valid but lambda s:`[sorted((1e9+s[:i].count(c),c)for i,c in enumerate(s))]`[18::21] works for strings with max length 9e9. | |
| Jan 11, 2017 at 4:00 | history | answered | Dennis | CC BY-SA 3.0 |