Re: [閒聊] 每日leetcode

作者: sustainer123 (caster)   2024-05-06 12:08:51
※ 引述《Rushia (早瀬ユウカの体操服 )》之銘言:
: https://leetcode.com/problems/remove-nodes-from-linked-list/description/
: 2487. Remove Nodes From Linked List
: 給你一個鏈結串列,移除串列中所有右邊存在比他大的數字的的節點。
: https://assets.leetcode.com/uploads/2022/10/02/drawio.png
: 思路:
: 1.題目其實是在求一個最長遞減串列,我們將原串列做反轉之後把遞增的串起來,再把
: 串起來的串列也反轉即可。
: py code:
:
作者: JIWP (JIWP)   2024-05-06 12:09:00
別卷了
作者: digua (地瓜)   2024-05-06 12:09:00
大師
作者: wu10200512 (廷廷)   2024-05-06 12:13:00
static跟全域變數滿像的只是你放在class裡就只能用class的static函數改
作者: JIWP (JIWP)   2024-05-06 12:14:00
跟C的static一樣嗎
作者: wu10200512 (廷廷)   2024-05-06 12:15:00
java就是換皮c++
作者: sustainer123 (caster)   2024-05-06 12:16:00
我C++沒學好QQ
作者: SecondRun (雨夜琴聲)   2024-05-06 12:17:00
不如C#
作者: JIWP (JIWP)   2024-05-06 12:17:00
剩我不會c++了要不要試試看用monotonic stack來解這一題
作者: sustainer123 (caster)   2024-05-06 12:27:00
我想一下怎解
作者: DJYOSHITAKA (Evans)   2024-05-06 12:29:00
剩我只會一種語言了
作者: sustainer123 (caster)   2024-05-06 12:31:00
老實講我也只熟python C學過一年但寫得不怎麼樣其他就摸過而已

Links booklink

Contact Us: admin [ a t ] ucptt.com