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

Related Articles

  1. Longest Substring Without Repeating Characters
  2. Daily Interview Problem: Decode String
  3. Daily Interview Problem: Deepest Node in a Binary Tree
  4. Daily Interview Problem: Merge K Sorted Linked Lists
  5. Algorithm Interview Question: Symmetric k-ary Tree
  6. Algorithm Interview: Shifted String
  7. Daily Interview Problem: Get all Values at a Certain Height in a Binary Tree
  8. Daily Interview Puzzle: Minimum Size Subarray Sum
  9. Daily Interview Problem: Largest Product of 3 Elements I
  10. [Daily Problem] Add two numbers as a linked list

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="index, follow">