文件: root - text - article - 2020 - 02 - generate-all-ip-addresses.txt
标签: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | 英文 | 主页 | 类别: 计算机科学 | 533 次阅读, 25357 次搜索 | 99 个单词
| 浏览 | 博客存档
标签: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | 英文 | 主页 | 类别: 计算机科学 | 533 次阅读, 25357 次搜索 | 99 个单词
| 浏览 | 博客存档
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']
标签: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | 英文 | 主页 | 类别: 计算机科学 | 533 次阅读, 25357 次搜索 | 99 个单词 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']
猜您喜欢...
- [Daily Problem] Remove Consecutive Nodes that Sum to 0
- [Daily Problem] Add two numbers as a linked list
- CPU Utilization
- Daily Interview Problem: Longest Substring With K Distinct Characters
- Linode Support Ticket 10029540 - Other - Important Notice Regarding Ubuntu 17.10 Image
- Daily Interview Problem: Look and Say Sequence
- Daily Interview Problem: Buddy Strings
- Algorithm Interview Question: H-Index
- Daily Interview Problem: Merge Overlapping Intervals
- Find Pythagorean Triplets
©2006~2024 牛排过熟 - 0.00884 秒 - 2167.894 KB/s - 44 在线 内存: 493.72 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - 服务器 PHP 版本号: 7.4.33
牛排怎么做才好吃? | <meta name="机器人" content="不索引, 跟踪" />
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - 服务器 PHP 版本号: 7.4.33
评论 (0)
读写完全 - 一般 - 最小 - 表格 - 所有评论 - 统计
当前页暂时没有评论。