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

Related Articles

  1. Daily Interview Puzzle: Ways to Traverse a Grid
  2. Algorithm Interview: No Adjacent Repeating Characters
  3. Staying on a Chess Board
  4. Daily Interview Problem: Contiguous Subarray with Maximum Sum
  5. New Vulnerabilities (CVE-2016-4581) have been detected in CentOS/RHEL/CloudLinux 7
  6. Floor and Ceiling of a Binary Search Tree
  7. Daily Interview Problem: Reverse Words in a String
  8. Daily Interview Problem: Count Number of Unival Subtrees
  9. Daily Interview Problem: Merge Overlapping Intervals
  10. Reverse a Linked List

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