【leetcode】解题日记(未完待续)-爱代码爱编程
开坑,有生之年系列,希望有一天能解出 l e e t c
代码编织梦想
【Problem 12】分饼干 介绍 易老师购买了一盒饼干,盒子中一共有k块饼干,但是数字k有些数位变得模糊了,看不清楚数字具体是多少了。易老师需要你帮忙把这k块饼干平分给n个小朋友,易老师保证这盒饼干能平分给n个小朋友
【Problem 6】工作安排 介绍 现在有n位工程师和6项工作(编号为0至5),现在给出每个人能够胜任的工作序号表(用一个字符串表示,比如:045,表示某位工程师能够胜任0号,4号,5号工作)。现在需要进行工作安排,每
【Problem 2】赶去公司 介绍 终于到周末啦!小易走在市区的街道上准备找朋友聚会,突然服务器发来警报,小易需要立即回公司修复这个紧急bug。假设市区是一个无限大的区域,每条街道假设坐标是(X,Y),小易当前在(0,
使用openssl库进行AES算法的加密 介绍 最近维护一个插件,需要添加一个小的功能,希望能够对用户的密码进行加密保存到文件中,然后再从文件中提取出加密后的数据,并进行解密。 功能很简单,目前也有着许多的开源库包含了
【Problem 5】分饼干 题目 小易拥有一个拥有魔力的手环上面有n个数字(构成一个环),当这个魔力手环每次使用魔力的时候就会发生一种奇特的变化:每个数字会变成自己跟后面一个数字的和(最后一个数字的后面一个数字是第一个
【Problem 1】双核处理 题目 一种双核CPU的两个核能够同时的处理任务,现在有n个已知数据量的任务需要交给CPU处理,假设已知CPU的每个核1秒可以处理1kb,每个核同时只能处理一项任务。n个任务可以按照任意顺序
13. Roman to Integer 介绍 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the
6. ZigZag Conversion 介绍 The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows l
128. Longest Consecutive Sequence 介绍 Given an unsorted array of integers, find the length of the longest conse
5. Longest Palindromic Substring 介绍 Given a string s, find the longest palindromic substring in s. You may ass
567. Permutation in String 介绍 Given two strings s1 and s2, write a function to return true if s2 contains the
83. Remove Duplicates from Sorted List 介绍 Given a sorted linked list, delete all duplicates such that each ele
61. Rotate List 介绍 Given a list, rotate the list to the right by k places, where k is non-negative. For examp
84. Largest Rectangle in Histogram 介绍 Given n non-negative integers representing the histogram’s bar height wh
4. Median of Two Sorted Arrays 介绍 There are two sorted arrays nums1 and nums2 of size m and n respectively. F
Maximum Subarray 和 Maximum Product Subarray 53. Maximum Subarray 介绍 Find the contiguous subarray within an ar
Majority Element 系列 169. Majority Element 介绍 Given an array of size n, find the majority element. The majorit
120. Triangle 介绍 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adj
Insert Delete GetRandom O(1) 系列 380. Insert Delete GetRandom O(1) 介绍 Design a data structure that supports al