Atcoder 【ABC325】Atcoder Beginner Contest325 A・B・C問題 解答・解説【Python】 A問題 解答 B問題 方針 0時~23時までを全探索 各時間から8時間差までの地域の参加可能人数を加えていく その合計の最大値を返す LeetCodeにも類題がある。考え方は... 2023.11.04 AtcoderAtcoder Beginner ContestA問題B問題C問題Pythonアルゴリズム幅優先探索深さ優先探索
Atcoder 【ABC】Atcoder Beginner Contest317 A,B,C問題 解答・解説【Python】 A - Potions 解答 N個の傷薬のリストPと、Hのヒットポイントを持つモンスターがいる。i番目の傷薬を使ってヒットポイントがX以上になった時、iを出力する。 Pは初めから小さい方から並んでいるので、fo... 2023.09.21 AtcoderAtcoder Beginner ContestC問題Pythonアルゴリズム再帰深さ優先探索
LeetCode 【LeetCode】 1448. Count Good Nodes in Binary Tree 解答・解説【Python】 はじめに LeetCodeの問題を解答します。 なるべく、問題の和訳と詳細なコメントを書いています。 余裕があれば、複数のアプローチの解答と、実際の面接を想定して英語での解法やコメントを書いています。 様々な... 2023.05.23 LeetCodePythonアルゴリズム再帰深さ優先探索
LeetCode 【LeetCode】 98. Validate Binary Search Tree 解答・解説【Python】 はじめに LeetCodeの問題を解答します。 なるべく、問題の和訳と詳細なコメントを書いています。 余裕があれば、複数のアプローチの解答と、実際の面接を想定して英語での解法やコメントを書いています。 ... 2023.05.14 LeetCodePythonアルゴリズムデータ構造二分探索木二分木深さ優先探索
LeetCode 【LeetCode】40. Combination Sum II 解答・解説【Python】 問題 原文 Given a collection of candidate numbers (candidates) and a target number (target), find all unique combination... 2023.04.30 LeetCodePythonアルゴリズムバックトラッキング深さ優先探索
LeetCode 【LeetCode】200. Number of Islands 解答・解説【Python】 問題 原文 Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the numb... 2023.04.23 LeetCodePythonアルゴリズム深さ優先探索
Python 【LeetCode】46. Permutations 解答・解説【Python】 問題 原文 Given an array nums of distinct integers, return all the possible permutations. You can return the answer in a... 2023.04.15 Pythonアルゴリズム深さ優先探索
LeetCode 【LeetCode】77. Combinations 解答・解説【Python】 問題 原文 Given two integers n and k, return all possible combinations of k numbers chosen from the range . You may r... 2023.04.15 LeetCodePythonアルゴリズム深さ優先探索
LeetCode 【LeetCode】695. Max Area of Island 解答・解説【Python】 はじめに LeetCodeの問題を解答します。 なるべく、問題の和訳と詳細なコメントを書いています。 余裕があれば、複数のアプローチの解答と、実際の面接を想定して英語での解法やコメントを書いています。 様々な... 2023.04.09 LeetCodePythonアルゴリズム深さ優先探索
LeetCode 【LeetCode】733. Flood Fill 解答・解説【Python】 学習メモ 自分の言葉で書くことで理解できていない部分をハッキリさせたい。 問題 原文 An image is represented by an m x n integer grid image where image repr... 2023.04.08 LeetCodePythonアルゴリズム幅優先探索深さ優先探索