# Leetcode Easy 804. Unique Morse Code Words

Statement International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c" maps to "-.-.", and so on. For convenience, the full table for…

# Leetcode Easy 1304.Find N Unique Integers Sum up to Zero

Statement Given an integer n, return any array containing n unique integers such that they add up to 0. 整数 n が与えられる 配列の総和が0になるように、n個の一意な整数を入れた配列を返せ Constrains 1 なぜこの制約をつけたんだろうか Example Ex…

# Leetcode Easy 1309. Decrypt String from Alphabet to Integer Mapping

Statement Given a string s formed by digits ('0' - '9') and '#'. We want to map s to English lowercase characters as follows: Characters ('a' to 'i') are represented by ('1' to '9') respectively. Characters ('j' to 'z') are represented by …

# Leetcode Easy 1221. Split a String in Balanced Strings

Statement Balanced strings are those who have equal quantity of 'L' and 'R' characters. Given a balanced string s split it in the maximum amount of balanced strings. Return the maximum amount of splitted balanced strings. 平衡文字列とは L…

# データ構造 : Binary Search Tree

Binary Search Tree Implements node Binary Search Tree Makefile result Binary Search Tree 二分木 ノードの実装は2種類ある class Node { public: int data_; Node *left_; Node *right_; Node(int data); }; と class Node { public: int data_; Node *…

# Leetcode Easy 938. Range Sum of BST

Statement 木？ データ構造 Traverse inorder preorder postorder 二分木構造と再帰について Answer まとめ https://leetcode.com/problems/range-sum-of-bst/ Statement Given the root node of a binary search tree, return the sum of values of all nod…

# データ構造 : Singly Linked List

Linked List とは Implementations node.cpp node.hpp singly_linkedlist.cpp singly_linkedlist.hpp Makefile main.cpp Result まとめ Linked List とは あとでまとめる Implementations node.cpp #include "node.hpp" Node::Node(int data) : data_{data},…

# Leetcode Easy 1266. Minimum Time Visiting All Points

Statement Constrains Example Answer 1 Answer 2 Answer 3 Loading... Statement On a plane there are n points with integer coordinates points[i] = [xi, yi]. Your task is to find the minimum time in seconds to visit all points. You can move ac…

# Leetcode Easy 1290. Convert Binary Number in a Linked List to Integer

Statement Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the …

# Leetcode Easy 1351. Count Negative Numbers in a Sorted Matrix

Statement Given a m * n matrix grid which is sorted in non-increasing order both row-wise and column-wise. Return the number of negative numbers in grid. m * n の行列が降順で整列済み状態で与えられる 行方向にも列方向にも整列されとる 行列内…

# Leetcode Easy 1295. Find Numbers with Even Number of Digits

Hatena Template Statement Given an array nums of integers, return how many of them contain an even number of digits. 整数値が配列で与えられる 奇数桁の数字がいくつ含まれるか返せ Example Example 1: Input: nums = [12,345,2,6,7896] Output: 2 E…

# Leetcode Easy 1281. Subtract the Product and Sum of Digits of an Integer

Statement Given an integer number n, return the difference between the product of its digits and the sum of its digits. 整数値nが与えられる。与えられた整数の桁の 総乗と総和の差を返却せよ Constrains 1 Example Example 1: Input: n = 234 Outpu…

# Leetcode Easy 771. Jewels and Stones

Statement You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the stones you have are also jewels. T…

# Leetcode Easy 1313. Decompress Run-Length Encoded List

Statement We are given a list nums of integers representing a list compressed with run-length encoding. Consider each adjacent pair of elements [a, b] = [nums[2*i], nums[2*i+1]] (with i >= 0). For each such pair, there are a elements with …

# 競技プログラミングのテンプレート

template #include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); } ヘッダファイル gccを入れると一緒に入ってくるヘッダファイル 標準ライブラリすべてを一括でインクルードできるヘッダファイル stdc++.hの中身は // C++</bits/stdc++.h>…

# Leetcode Easy 1108. Defanging an IP Address

Statement Given a valid (IPv4) IP address, return a defanged version of that IP address. "A defanged IP address" replaces every period "." with "[.]". 正しいIPv4アドレスが与えられる。IPアドレスを牙を抜いたバージョンで返せ。 牙を抜かれたIP…

# Leetcode Easy 1342. Number of Steps to Reduce a Number to Zero

Statement Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it. 負で無い整数（正の整数）が与えられる。その数…