摘要:
1. 题目 1.1 英文题目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. | Symbol | Value | | | | | I | 1 | | V | 5 | | X | 1 阅读全文
摘要:
1. 定义: 向量(Vector)是一个封装了动态大小数组的顺序容器(Sequence Container)可以认为是一个动态数组,其中一个vector中的所有对象都必须是同一种类型的。 #2. 构造函数: 2.1 一般情况 vector vecName(); // 构造一个空vector,其中包含 阅读全文
摘要:
1. 题目 1.1 英文题目 Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. Y 阅读全文
摘要:
1. 问题引入 通过查看[https://www.cplusplus.com/reference/vector/vector/] 的vector.size()说明,即 | member type | definition | notes | | | | | | size_type| an unsig 阅读全文
摘要:
1. 题目 1.1 英文题目 Given an array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific 阅读全文
摘要:
1. 题目 1.1 英文题目 Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a soluti 阅读全文
摘要:
1. 题目 1.1 英文题目 You are given an array prices where prices[i] is the price of a given stock on the ith day. Find the maximum profit you can achieve. Yo 阅读全文
摘要:
1. 题目 1.1 英文题目 You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosin 阅读全文
摘要:
1. 题目 1.1 英文题目 Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle. In Pascal's triangle, each number is the sum 阅读全文
摘要:
1. 题目 1.1 英文题目 Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree. A hei 阅读全文