アルゴリズム

LeetCode

【LeetCode】344. Reverse String 解答・解説【Python】

問題 原文 Write a function that reverses a string. The input string is given as an array of characters s. You must do...
LeetCode

【LeetCode】167. Two Sum II – Input Array Is Sorted 解答・解説【Python】

問題 原文 Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers s...
LeetCode

【LeetCode】283. Move Zeroes 解答・解説【Python】

問題 原文 Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zer...
LeetCode

【LeetCode】15. 3Sum 解答・解説【Python】

問題 原文 Given an integer array nums, return all the triplets , nums, nums] such that i != j, i != k, and j != k, and n...
LeetCode

【LeetCode】278. First Bad Version 解答・解説【Python】

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

【LeetCode】5. Longest Palindromic Substring 解答・解説【Python】

問題 原文 Given a string s, return the longest palindromic substring in s. Example 1: Example 2: Constraint...
LeetCode

【LeetCode】3.Longest Substring Without Repeating Characters 解答・解説【Python】

問題 原文 Given a string s, find the length of the longest substring without repeating characters. Example 1: ...
LeetCode

【LeetCode】704. Binary Search 解答・解説【Python】

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

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

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