Skip to content

solve: 283.Move Zeroes#54

Open
t9a-dev wants to merge 1 commit intomainfrom
283.-Move-Zeroes
Open

solve: 283.Move Zeroes#54
t9a-dev wants to merge 1 commit intomainfrom
283.-Move-Zeroes

Conversation

@t9a-dev
Copy link
Owner

@t9a-dev t9a-dev commented Feb 25, 2026

問題: 283. Move Zeroes
次に解く問題: 252. Meeting Rooms(LINTCODE版)
ファイルの構成: ./src/bin/<各ステップ>.rs

https://ja.wikipedia.org/wiki/%E3%83%AB%E3%83%BC%E3%83%97%E5%B1%95%E9%96%8B

https://github.com/Yoshiki-Iwasa/Arai60/pull/59/changes#diff-8201a9b64da970a353f0eb106023266ce67230b908a5213848bdfa1793d8574c
- Erase-remove idiomのRust実装例。retain(), resize()メソッドどちらも使ったことがなく新しいメソッドを知れた。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(してそうですが)新しいメソッドをみたら一応見ておきましょう。
https://doc.rust-lang.org/std/vec/struct.Vec.html#method.retain
https://doc.rust-lang.org/std/vec/struct.Vec.html#method.resize

- 少しパズルに感じる。step2a.rsでErase-remove idiomを試してみる。
*/

pub struct Solution {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

自分が面接官としてこの問題を出題するとしたら、 Erase-remove idiom を知っていて書けるかどうかを主題とすると思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants