To the Top
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 | 456 Views, 24072 Search Bots | 57 Words

Subscribe to Feed Burner | 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


def rearrangeString(s):
# Fill this in.

print rearrangeString('abbccc')
# cbcabc
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 456 Views, 24072 Search Bots | 57 Words Subscribe to Feed Burner

Related Articles

  1. Kaprekar
  2. Sort a Partially Sorted List
  3. Linode Support Ticket 10029540 - Other - Important Notice Regarding Ubuntu 17.10 Image
  4. Floor and Ceiling of a Binary Search Tree
  5. Batch Programming in XP
  6. Daily Interview Problem: Look and Say Sequence
  7. Top K Frequent words
  8. Daily Interview Problem: Sort Colors
  9. Daily Interview Problem: Group Words that are Anagrams
  10. A trick for getting good at coding interviews FASTER

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />