File: root - text - article - 2020 - 01 - no-adjacent-repeating-characters.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 437 Views, 22930 Search Bots | 57 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 437 Views, 22930 Search Bots | 57 Words
| Browse | Archive
Hi, here's your problem today. This problem was recently asked by LinkedIn:
Given a string, rearrange the string so that no character next to each other are the same. If no such arrangement is possible, then return None.
Example:
Input: abbccc
Output: cbcbca
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 437 Views, 22930 Search Bots | 57 Words Given a string, rearrange the string so that no character next to each other are the same. If no such arrangement is possible, then return None.
Example:
Input: abbccc
Output: cbcbca
def rearrangeString(s):
# Fill this in.
print rearrangeString('abbccc')
# cbcabc
Related Articles
- Daily Interview Problem: Find the Number of Islands
- Spreadsheet Columns
- Maximum In A Stack
- Daily Interview Question: Find Cycles in a Graph
- Daily Interview Problem: Product of Array Except Self
- Daily Interview Question: Create a Simple Calculator
- Binary Tree Level with Minimum Sum
- Daily Interview Problem: First Missing Positive Integer
- Algorithm Interview Question: Find the Single Element in an Array of Duplicates
- Plus One
©2006~2024 SteakOverCooked - 0.00761 Seconds(s) - 7045.109 KB/s - 31 Online Memory: 527.9 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Comments (0)
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !