![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
烟火笑风尘
众生皆苦
展开
-
237. 删除链表中的节点
struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(nullptr) {} }; class Solution { public: void deleteNode(ListNode *node) { while (node->next...原创 2019-11-28 17:47:02 · 106 阅读 · 0 评论 -
1108. IP 地址无效化
#include <iostream> #include <string> using namespace std; class Solution { public: string defangIPaddr(string address) { int pos = 0; while ((pos = address....原创 2019-11-28 15:15:24 · 101 阅读 · 0 评论 -
458. Poor Pigs
#encoding=utf-8 import math ''' 如果测试时间是1小时,猪的死亡时间是15分钟,1只猪可以判断5桶水,2只猪可以判断25桶水。... ''' class Solution(object): def poorPigs(self, buckets, minutesToDie, minutesToTest): """ :typ...原创 2019-01-11 22:11:54 · 134 阅读 · 0 评论