To the Top
File:  root - text - article - 2019 - 12 - decode-string.txt.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 454 Views, 15703 Search Bots | 67 Words

Subscribe to Feed Burner | Browse | Archive
Hi, here's your problem today. This problem was recently asked by Google:

Given a string with a certain rule: k[string] should be expanded to string k times. So for example, 3[abc] should be expanded to abcabcabc. Nested expansions can happen, so 2[a2[b]c] should be expanded to abbcabbc.

Your starting point:

def decodeString(s):
# Fill this in.

print decodeString('2[a2[b]c]')
# abbcabbc
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 454 Views, 15703 Search Bots | 67 Words Subscribe to Feed Burner

Related Articles

  1. Daily Interview Problem: Spiral Traversal of Grid
  2. Non-decreasing Array with Single Modification
  3. [Daily Problem] Move Zeros
  4. Daily Interview Problem: Word Ordering in a Different Alphabetical Order
  5. Number of Ways to Climb Stairs
  6. Daily Interview Problem: Get all Values at a Certain Height in a Binary Tree
  7. Daily Interview Problem: Arithmetic Binary Tree
  8. Daily Interview Problem: Merge List Of Number Into Ranges
  9. Top K Frequent words
  10. Spreadsheet Columns

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