会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
自己单
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
下一页
2022年11月11日
Reverse Linked List
摘要: https://leetcode.cn/problems/reverse-linked-list-ii/ class Solution: def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Opti
阅读全文
posted @ 2022-11-11 23:18 7aughing
阅读(18)
评论(0)
推荐(0)
2022年11月9日
Least Number of Unique Integers after K Removals
摘要: https://leetcode.cn/problems/least-number-of-unique-integers-after-k-removals/ # https://leetcode.com/problems/least-number-of-unique-integers-after-k
阅读全文
posted @ 2022-11-09 08:01 7aughing
阅读(15)
评论(0)
推荐(0)
2022年11月7日
Reach a Number
摘要: https://leetcode.cn/problems/reach-a-number/ # 假设target=4, # 一直累加步数,直到其正好大于等于target # 0 + 1 + 2 + 3 = 6 # 此时累加和已经大于target,且差值为偶数6-4=2;那么实际上只要将加上距离为1的时
阅读全文
posted @ 2022-11-07 07:33 7aughing
阅读(24)
评论(0)
推荐(0)
2022年11月6日
Palindrome Partitioning II
摘要: https://leetcode.cn/problems/palindrome-partitioning-ii/ # dp[i] 表示 s[0..i] 切分为回文子串的最小分割次数 # dp[i] = min(dp[j] + 1) , 如果 s[j+1...i]是回文串, j < i # dp[i]
阅读全文
posted @ 2022-11-06 20:20 7aughing
阅读(13)
评论(0)
推荐(0)
Flip String to Monotone Increasing
摘要: https://leetcode.cn/problems/flip-string-to-monotone-increasing/ def minFlipsMonoIncr(self, s: str) -> int: # n0: 统计当前字符的右边还有多少个0需要被置为1 # n1: 统计当前字符的左
阅读全文
posted @ 2022-11-06 19:35 7aughing
阅读(24)
评论(0)
推荐(0)
Find the Duplicate Number
摘要: https://leetcode.cn/problems/find-the-duplicate-number/submissions/ 方法1:pos记录无重复区间的下一个位置 (TLE) def findDuplicate(self, nums: List[int]) -> int: pos =
阅读全文
posted @ 2022-11-06 13:45 7aughing
阅读(24)
评论(0)
推荐(0)
Implement Queue using Stacks
摘要: https://leetcode.cn/problems/implement-queue-using-stacks/ push: 直接插入辅助栈 pop/peak: 1.如果数据栈有数据,直接出栈; 2.1.否则,如果辅助栈有数据,不停出栈给到数据栈 2.2.出栈数据栈中的元素 class MyQu
阅读全文
posted @ 2022-11-06 11:15 7aughing
阅读(8)
评论(0)
推荐(0)
2022年10月22日
wordLadder i/ii
摘要: https://leetcode.cn/problems/word-ladder/
阅读全文
posted @ 2022-10-22 23:31 7aughing
阅读(15)
评论(0)
推荐(0)
nan踩坑记
摘要: 检查数据 如果输入的是图片数据,先检查是否有 打不开的图片/大小明显异常的图片; 检查输入模型的数据是否与所使用的loss函数提供接口中的要求相一致。 检查所有除式中的分母 特别是在自己实现的归一化函数中,尤其需要注意。 检查是否有进行log_softmax。 检查是否有使用正确的激活函数。 如果在
阅读全文
posted @ 2022-10-22 23:06 7aughing
阅读(37)
评论(0)
推荐(0)
Tensorflow解析tfrecord
摘要: 1、序列化 #coding:utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np im
阅读全文
posted @ 2022-10-22 22:53 7aughing
阅读(137)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告