LeetCode

【LeetCode】82. Remove Duplicates from Sorted List II 解答・解説【Python】

問題 原文 Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct nu...
LeetCode

【LeetCode】61. Rotate List 解答・解説【Python】

問題 原文 Given the head of a linked list, rotate the list to the right by k places. Example 1: Example 2:...
LeetCode

【LeetCode】2. Add Two Numbers 解答・解説【Python】

問題 原文 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reve...
Python

【Python】基本操作

・ライブラリのインストール時は注意してください。悪意を持った動作をするライブラリが存在します。それらは、有名なライブラリと似せた名前になっていることがあります。pip install時、間違えて打ち込むとマルウェアが仕込まれたライブラリを取...
LeetCode

【LeetCode】1232. Check If It Is a Straight Line 解答・解説【Python】

はじめに LeetCodeの問題を解答します。 なるべく、問題の和訳と詳細なコメントを書いています。 余裕があれば、複数のアプローチの解答と、実際の面接を想定して英語での解法やコメントを書いています。 様々なカテ...
LeetCode

【LeetCode】1290. Convert Binary Number in a Linked List to Integer 解答・解説【Python】

問題 原文 Given head which is a reference node to a singly-linked list. The value of each node in the linked list is eit...
LeetCode

【LeetCode】876. Middle of the Linked List 解答・解説【Python】

はじめに LeetCodeの問題を解答します。 なるべく、問題の和訳と詳細なコメントを書いています。 余裕があれば、複数のアプローチの解答と、実際の面接を想定して英語での解法やコメントを書いています。 様々なカテ...
LeetCode

【LeetCode】217. Contains Duplicate 解答・解説【Python】

問題 原文 Given an integer array nums, return true if any value appears at least twice in the array, and return false if...
LeetCode

【LeetCode】141. Linked List Cycle 解答・解説【Python】

問題 原文 Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in ...
LeetCode

【LeetCode】136. Single Number 解答・解説【Python】

問題 原 Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. ...