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 | 165 Views, 18304 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 | 165 Views, 18304 Search Bots | 57 Words Subscribe to Feed Burner

Related Articles

  1. [Daily Problem] Validate Balanced Parentheses
  2. Algorithm Interview Question: Nth Fibonacci Number
  3. Daily Interview Problem: Look and Say Sequence
  4. Batch Programming in XP
  5. Longest Substring Without Repeating Characters
  6. 56 Bytes
  7. Algorithm Interview: String Compression
  8. ImageMagick Vulnerabilities -  CVE-2016–3714
  9. Autorun.inf Virus Protection
  10. Daily Interview Problem: Longest Substring With K Distinct Characters

Comments (0)

    Be the first one to comment this page !


Page Edited: October 30 2020 14:21:09 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />