随笔分类 - LeetCode
摘要:要求: 输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点)。返回一个该链表的深度拷贝。 思路: 1、遍历该链表,复制每一个节点,插入到当前节点的后面.形成如下链表.1->1'->2->2'.... 2、将每个拷贝节点的随机指针域,指向原节点(即拷
阅读全文
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 题目要求不能使用除号、乘号和取余操作符。 我们使用移位操作符。<< 左移代表
阅读全文
摘要:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic
阅读全文
摘要:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers.
阅读全文
摘要:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of
阅读全文
摘要:Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below
阅读全文
摘要:Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 Have you thought about this? Here are some good questions t
阅读全文
摘要:题目描述: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes
阅读全文
浙公网安备 33010602011771号