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

Related Articles

  1. Batch Programming in XP
  2. Daily Interview Problem: Merge Overlapping Intervals
  3. How to Play WAV music under DOS?
  4. Daily Interview Question: Create a Simple Calculator
  5. [Daily Problem] Remove Consecutive Nodes that Sum to 0
  6. Non-decreasing Array with Single Modification
  7. Algorithm Interview: Determine If Linked List is Palindrome
  8. [Daily Problem] Validate Balanced Parentheses
  9. Daily Interview Problem: Circle of Chained Words
  10. Algorithm Interview Question: Nth Fibonacci Number

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" />