上一页 1 2 3 4 5 6 7 8 9 ··· 43 下一页

2020年11月7日

leetcode bitmap系列问题整理

摘要: 1、 题目: 编写一个函数,输入是一个无符号整数,返回其二进制表达式中数字位数为 ‘1’ 的个数(也被称为汉明重量)。 示例 : 输入: 11输出: 3解释: 整数 11 的二进制表示为 00000000000000000000000000001011 示例 2: 输入: 11输出: 3解释: 整数 阅读全文

posted @ 2020-11-07 10:10 wsw_seu 阅读(242) 评论(0) 推荐(0) 编辑

2020年11月5日

334. Increasing Triplet Subsequence(也可以使用dp动态规划)

摘要: Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if 阅读全文

posted @ 2020-11-05 22:30 wsw_seu 阅读(82) 评论(0) 推荐(0) 编辑

2020年11月4日

c++ priority_queue应用(重要)

摘要: 自定义排序 重写仿函数 struct cmp{ bool operator() ( Node a, Node b ){//默认是less函数 //返回true时,a的优先级低于b的优先级(a排在b的后面) if( a.x== b.x ) return a.y> b.y; return a.x> b. 阅读全文

posted @ 2020-11-04 21:32 wsw_seu 阅读(175) 评论(0) 推荐(0) 编辑

2020年11月1日

378. Kth Smallest Element in a Sorted Matrix(大顶堆、小顶堆)

摘要: Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th 阅读全文

posted @ 2020-11-01 17:05 wsw_seu 阅读(89) 评论(0) 推荐(0) 编辑

395. Longest Substring with At Least K Repeating Characters

摘要: Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than  阅读全文

posted @ 2020-11-01 11:48 wsw_seu 阅读(52) 评论(0) 推荐(0) 编辑

2020年10月29日

454. 4Sum II

摘要: Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero. To make pro 阅读全文

posted @ 2020-10-29 21:58 wsw_seu 阅读(69) 评论(0) 推荐(0) 编辑

218. The Skyline Problem

摘要: 城市的天际线是从远处观看该城市中所有建筑物形成的轮廓的外部轮廓。现在,假设您获得了城市风光照片(图A)上显示的所有建筑物的位置和高度,请编写一个程序以输出由这些建筑物形成的天际线(图B)。 每个建筑物的几何信息用三元组 [Li,Ri,Hi] 表示,其中 Li 和 Ri 分别是第 i 座建筑物左右边缘 阅读全文

posted @ 2020-10-29 21:57 wsw_seu 阅读(90) 评论(0) 推荐(0) 编辑

2020年10月25日

327. 区间和的个数

摘要: 给定一个整数数组 nums,返回区间和在 [lower, upper] 之间的个数,包含 lower 和 upper。区间和 S(i, j) 表示在 nums 中,位置从 i 到 j 的元素之和,包含 i 和 j (i ≤ j)。 说明:最直观的算法复杂度是 O(n2) ,请在此基础上优化你的算法。 阅读全文

posted @ 2020-10-25 12:54 wsw_seu 阅读(102) 评论(0) 推荐(0) 编辑

2020年10月19日

37 Sudoku Solver

摘要: Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: Each of the digits 1-9 阅读全文

posted @ 2020-10-19 22:19 wsw_seu 阅读(61) 评论(0) 推荐(0) 编辑

2020年10月18日

36. Valid Sudoku

摘要: Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each row must contain the dig 阅读全文

posted @ 2020-10-18 16:12 wsw_seu 阅读(94) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 43 下一页

导航