Skip to content

83 Remove Duplicates from Sorted List#5

Open
subaru-hello wants to merge 2 commits into
mainfrom
feat/83-remove-duplicates-from-sorted-list
Open

83 Remove Duplicates from Sorted List#5
subaru-hello wants to merge 2 commits into
mainfrom
feat/83-remove-duplicates-from-sorted-list

Conversation

@subaru-hello
Copy link
Copy Markdown
Owner

今回解いた問題:83. Remove Duplicates from Sorted List
次に解く問題 :82. Remove Duplicates from Sorted List II
言語:Python

問題

https://leetcode.com/problems/remove-duplicates-from-sorted-list/

学習方法

Step 1

答えを見てもいいのでとにかく正解になったらOK(標準的な進め方と同様)

Step 2

  1. コードを自分なりに整形する
  2. 他の人のコードとコメントを読み、それを踏まえて再整形する。正解することを確認する(ここでレビュー依頼をする=本 Pull Request)

Step 3

レビューを踏まえて整形する。その後、10分以内にエラーを出さずに書く


### Step 2
1. コードを自分なりに整形する
- is not Noneを外せそうなことに気がついた。できるだけif文の中にnot入れたくない気持ちを持った。少し読みづらくなるため。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

#3
にもコメントさせていただきましたが、こちらのコメントをご参照ください。
ksaito0629/leetcode_arai60#1 (comment)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

ありがとうございます!

読みやすさではなく、意図しない評価をしない、という目的があるとわかりました!

def deleteDuplicates(self, head):
if head == None:
return None
previousNode = head
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

こちらのコメントをご参照ください。
tNita/arai60#3 (comment)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

ありがとうございます!pythonではローカル変数をsnake caseで表現することが多いということがわかりました!

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.

2 participants