摘要: 2020.2.6 494. Target Sum 我用的递归暴力解决的笨方法,本题有一种动态规划的好方法,但不能理解。待学习; 博客链接:https://www.cnblogs.com/qiang-wei/p/12271263.html 题目链接:https://leetcode.com/probl 阅读全文
posted @ 2020-02-06 23:19 强威 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = 阅读全文
posted @ 2020-02-06 23:18 强威 阅读(150) 评论(0) 推荐(0) 编辑
摘要: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文
posted @ 2020-02-06 22:24 强威 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input 阅读全文
posted @ 2020-02-06 13:15 强威 阅读(112) 评论(0) 推荐(0) 编辑