摘要:
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled 阅读全文
摘要:
Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Find the 阅读全文
摘要:
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: 阅读全文
摘要:
除了普通迭代器,C++标准模板库还定义了几种特殊的迭代器,分别是插入迭代器、流迭代器、反向迭代器和移动迭代器,定义在<iterator>头文件中,下面主要介绍三种插入迭代器(back_inserter,inserter,front_inserter)的区别。 首先,什么是插入迭代器?插入迭代器是指被 阅读全文
摘要:
Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not conta 阅读全文
摘要:
Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Exampl 阅读全文
摘要:
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the 阅读全文
摘要:
list::splice实现list拼接的功能。将源list的内容部分或全部元素删除,拼插入到目的list。 函数有以下三种声明: void splice ( iterator position, list<T,Allocator>& x ); void splice ( iterator posi 阅读全文
摘要:
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra 阅读全文
摘要:
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa 阅读全文