leetcode算法题
garrulousabyss
Github: https://github.com/Gogogoforit
展开
-
1. 两数之和
【代码】1. 两数之和。原创 2024-01-30 00:28:24 · 306 阅读 · 0 评论 -
002. Add Two Numbers
题目描述 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 contain a single digit. Add the two numbers and re...原创 2018-09-25 22:04:39 · 92 阅读 · 0 评论 -
leetcode之DP总结
leetcode之DP总结 2017年07月29日 22:51:39 svdalv 阅读数:357 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ns708865818/article/details/76266896 303. Range Sum Query - Immutable 解题思路:给定一个数组,计算给定区间的数字的和。利用D...原创 2018-10-03 22:29:33 · 310 阅读 · 0 评论 -
LeetCode总结 -- 一维动态规划篇
这篇文章的主题是动态规划, 主要介绍LeetCode中一维动态规划的题目, 列表如下: Climbing Stairs Decode Ways Unique Binary Search Trees Maximum Subarray Maximum Product Subarray Best Time to Buy and Sell Stock 在介绍上述具体题目之前, 我们先说说动态...转载 2018-10-06 02:18:41 · 145 阅读 · 0 评论 -
019. Remove Nth Node From End of List【C++】
//Method 1: Two-pass approach /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class...原创 2019-08-28 23:08:40 · 128 阅读 · 0 评论 -
001. Two Sum.cpp【C++】
//题目链接:https://leetcode.com/problems/two-sum/ class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { for(size_t i{0}; i < nums.size(); i++){ ...原创 2019-08-28 23:10:30 · 140 阅读 · 0 评论 -
002. Add Two Numbers【C++】
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* a...原创 2019-08-29 00:04:05 · 88 阅读 · 0 评论 -
21. Merge Two Sorted Lists【C++】
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* m...原创 2019-08-29 00:19:50 · 135 阅读 · 0 评论