<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Michelle_jx的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Michelle_jx</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Michelle_jx]]></copyright><item><title><![CDATA[ubuntu20.04装nvidia驱动后无法登录]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/123270360</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/123270360</guid><author>Michelle_jx</author><pubDate>Fri, 04 Mar 2022 10:13:31 +0800</pubDate><description><![CDATA[ubuntu20.04无法登录]]></description><category></category></item><item><title><![CDATA[Leetcode[402] 移掉k位数字]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/110490300</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/110490300</guid><author>Michelle_jx</author><pubDate>Wed, 02 Dec 2020 16:45:59 +0800</pubDate><description><![CDATA[&nbsp;
思路：
用ans栈来表示结果
每次遍历如果第i位小于ans栈顶，说明删掉栈顶数字会变小，然后把第i位压入栈

&nbsp;
class Solution:
    def removeKdigits(self, num: str, k: int) -&gt; str:
        ans=[num[0]]
        for i in range(1,len(num)):
            while (len(ans)!=0 and num[i]&lt;ans[-1] and.]]></description><category></category></item><item><title><![CDATA[Leetcode[321] 拼接最大数]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/110489027</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/110489027</guid><author>Michelle_jx</author><pubDate>Wed, 02 Dec 2020 16:25:33 +0800</pubDate><description><![CDATA[&nbsp;
思路：
这题我要写吐了
前前后后两个多小时，菜鸡本鸡了
先取单独列表保留i位最大数字，再根据两个列表(i,k-i)组合插序得到结果

&nbsp;
&nbsp;

有几个地方走了弯路，要mark下来
自己写的sort也懒得删掉了，完全可以通过List比较
1.两个列表插序的时候，可以直接用List的比较
List比较方式：按顺序从头比较，若均相同，以长度为准。
2.通过删减让单列表的数字最大或最小时
可按顺序遍历，根据现指针，决定前一项是否保留
有序列表-&gt;考虑栈

&nbsp;
cl.]]></description><category></category></item><item><title><![CDATA[[Leetcode] 剑指offer12 矩阵中的路径]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/109850626</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/109850626</guid><author>Michelle_jx</author><pubDate>Fri, 20 Nov 2020 15:24:24 +0800</pubDate><description><![CDATA[&nbsp;
思路：
这道题写了超级超级久
wa了很多次，主要是时间超时
最后一个测试用例太变态了
调整了很多次搜索方法加了很多判断再遍历也不行
最后发现是退出递归的问题
如果很深层的递归，一旦发现问题的解，立刻退出全部递归！

&nbsp;
class Solution:
    def exist(self, board: List[List[str]], word: str) -&gt; bool:
        if word=='':
            return True
     .]]></description><category></category></item><item><title><![CDATA[[Leetcode] 147 对链表进行插入排序]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/109839728</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/109839728</guid><author>Michelle_jx</author><pubDate>Fri, 20 Nov 2020 09:50:47 +0800</pubDate><description><![CDATA[&nbsp;
思路：
这也太想直接用列表排序了（面试官：回去等通知吧）
思路题目已经明确了
对未排序部分循环插入已排序部分
用vis和unvis来表示两部分
记得将vis和unvis之间的链接打断
速度很慢，应该可以在插入的时候加一个直接到末位的判断，可能会减少很多时间

&nbsp;
class Solution:
    def insertionSortList(self, head: ListNode) -&gt; ListNode:
        if not head or not head.]]></description><category></category></item><item><title><![CDATA[[Leetcode] 剑指offer31 栈的压入、弹出序列]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/109826940</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/109826940</guid><author>Michelle_jx</author><pubDate>Thu, 19 Nov 2020 21:56:13 +0800</pubDate><description><![CDATA[&nbsp;
思路：
一开始思路走偏了，尝试利用索引判断
不如直接模拟一个栈来操作
依次压入pushed列表，按popped顺序弹出

&nbsp;
class Solution:
    def validateStackSequences(self, pushed: List[int], popped: List[int]) -&gt; bool:
        stack=[]
        i=0
        for num in pushed:
            stack.app.]]></description><category></category></item><item><title><![CDATA[[Leetcode]剑指offer66 构建乘积数组]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/109823793</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/109823793</guid><author>Michelle_jx</author><pubDate>Thu, 19 Nov 2020 20:06:45 +0800</pubDate><description><![CDATA[&nbsp;
思路：
特想暴力ac，但估计时间超时
不能用除法的话，暂时想到用缓存的办法
用两个数组分别记录从左乘到右、从右乘到左

&nbsp;
class Solution:
    def constructArr(self, a: List[int]) -&gt; List[int]:
        left,right=[],[]
        res=[]
        for i in range(len(a)):
            if i==0:
              .]]></description><category></category></item><item><title><![CDATA[[Leetcode] 剑指offer13 机器人的运动范围]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/109823681</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/109823681</guid><author>Michelle_jx</author><pubDate>Thu, 19 Nov 2020 20:03:19 +0800</pubDate><description><![CDATA[&nbsp;
思路：
深度或者广度遍历，不过会浪费很多时间
&nbsp;
class Solution:
    def movingCount(self, m: int, n: int, k: int) -&gt; int:
        count=0
        visited=[]
        def sum(x):
            y=0
            while x!=0:
                y=y+x%10
                x=x//.]]></description><category></category></item><item><title><![CDATA[[Leetcode]283 移动零]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/109804809</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/109804809</guid><author>Michelle_jx</author><pubDate>Thu, 19 Nov 2020 11:07:43 +0800</pubDate><description><![CDATA[&nbsp;
思路：
直接排序，设计一种函数让数字非0即1，根据函数值由小到大排序
&nbsp;
class Solution:
    def moveZeroes(self, nums: List[int]) -&gt; None:
        """
        Do not return anything, modify nums in-place instead.
        """
        
        nums.sort(key=lambda x:-1*(x!=0)).]]></description><category></category></item><item><title><![CDATA[Ubuntu16.04 配置ros+pytorch+cv2]]></title><link>https://blog.youkuaiyun.com/Michelle_jx/article/details/107665578</link><guid>https://blog.youkuaiyun.com/Michelle_jx/article/details/107665578</guid><author>Michelle_jx</author><pubDate>Wed, 29 Jul 2020 15:25:42 +0800</pubDate><description><![CDATA[Ubuntu16.04 配置ros+pytorch+cv2
最近安装这个环境，踩了很多坑，备份一下。
1、首先明确ros不一定完美支持python3，所以暂时先装在python2里。不过py2好像2021年停用。
2、如果想在python3搭环境，就确保pip3和所用的python3环境是否相同，可以通过pip3 -V查看。如果不相同的话，用软链接相连一下，这个网上有很多的教程，但注意要找到自己文件的位置。
3、要提前安装好驱动和cuda，N卡驱动可以在设置里面的其他驱动下载（需要重启），cuda我安装的是]]></description><category></category></item></channel></rss>