You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise).
Given an m x n
matrix. If an element is 0, set its entire row and column to 0. Do it in-place.
Given a collection of intervals, merge all overlapping intervals.
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
给定一个链表,其中奇数位是升序的,偶数位是降序的,实现链表的排序。
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.
Reverse a singly linked list.
最近处理的单据业务经常会因为接口不幂等导致数据出错的情况。所以幂等性在设计系统的时候一定要考虑进去,尤其是像支付宝、银行、互联网金融公司等涉及的都是钱的系统,既要高效,也要准确,所以不能出现多扣款、多打款等问题,不然这样会很难处理,用户体验也不会好。
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get
and put
.
Return True
if the path crosses itself at any point, that is, if at any time you are on a location you've previously visited. Return False
otherwise.
Implement pow(x, n), which calculates x raised to the power n (xn).
Given a non-empty string s
, you may delete at most one character. Judge whether you can make it a palindrome.