06 2020 档案

摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文
posted @ 2020-06-28 23:00 琴影 阅读(265) 评论(0) 推荐(0) 编辑
摘要:The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 阅读全文
posted @ 2020-06-25 21:13 琴影 阅读(234) 评论(0) 推荐(0) 编辑
摘要:Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or 阅读全文
posted @ 2020-06-21 22:16 琴影 阅读(329) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return the sum of values of nodes with even-valued grandparent. (A grandparent of a node is the parent of its parent, if it exist 阅读全文
posted @ 2020-06-07 23:34 琴影 阅读(341) 评论(0) 推荐(0) 编辑
摘要:Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, yo 阅读全文
posted @ 2020-06-05 11:15 琴影 阅读(252) 评论(0) 推荐(0) 编辑
摘要:Given a m * n matrix mat and an integer K, return a matrix answer where each answer[i][j] is the sum of all elements mat[r][c] for i - K <= r <= i + K 阅读全文
posted @ 2020-06-04 23:00 琴影 阅读(615) 评论(2) 推荐(0) 编辑
摘要:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1,9], wh 阅读全文
posted @ 2020-06-04 16:10 琴影 阅读(239) 评论(0) 推荐(0) 编辑
摘要:There are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i][0], and the cost of flying the i-th p 阅读全文
posted @ 2020-06-04 13:50 琴影 阅读(327) 评论(0) 推荐(0) 编辑
摘要:Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: [0,1] Output: 2 Explanation: [0 阅读全文
posted @ 2020-06-03 23:29 琴影 阅读(230) 评论(0) 推荐(0) 编辑