To the Top
File:  root - text - article - 2020 - 02 - generate-all-ip-addresses.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 216 Views, 20441 Search Bots | 99 Words

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

An IP Address is in the format of A.B.C.D, where A, B, C, D are all integers between 0 to 255.

Given a string of numbers, return the possible IP addresses you can make with that string by splitting into 4 parts of A, B, C, D.

Keep in mind that integers can't start with a 0! (Except for 0)

Example:
Input: 1592551013
Output: ['159.255.101.3', '159.255.10.13']

def ip_addresses(s, ip_parts=[]):
# Fill this in.

print ip_addresses('1592551013')
# ['159.255.101.3', '159.255.10.13']
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 216 Views, 20441 Search Bots | 99 Words Subscribe to Feed Burner

Related Articles

  1. Two Tricks of Delphi
  2. Daily Interview Puzzle: Minimum Size Subarray Sum
  3. Algorithm Interview: Make the Largest Number
  4. Algorithm Interview: Longest Consecutive Sequence
  5. Algorithm Interview Question: Find the Single Element in an Array of Duplicates
  6. [Daily Problem] Longest Palindromic Substring
  7. Algorithm Interview: Level Order Traversal of Binary Tree
  8. Daily Interview Problem: Largest BST in a Binary Tree
  9. Kaprekar
  10. Reverse a Directed Graph

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: October 30 2020 14:21:09 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />