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

Related Articles

  1. Daily Interview Problem: Find the k-th Largest Element in a List
  2. Skip the readings, focus on problems. And use all the hints!
  3. Daily Interview Problem: Tree Serialization
  4. Algorithm Interview: Maximum Path Sum in Binary Tree
  5. Daily Interview Problem: Largest BST in a Binary Tree
  6. Algorithm Interview: Longest Consecutive Sequence
  7. Find the non-duplicate number
  8. Sorting a list with 3 unique numbers
  9. Daily Interview Problem: Arithmetic Binary Tree
  10. [Daily Problem] Remove Consecutive Nodes that Sum to 0

Comments (0)

Your Email (Domain Part Not Exposed):

Your Comments:

Privately By Mail Colors More Smileys S x y @

Verification (Click Image 2 Refresh):

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