03 2019 档案
摘要:Problem Description: Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. 题解: 这个题很容易想到复杂度为O(n^2)的暴力方法。
阅读全文
摘要:Problem Description: Your are given an array of positive integers nums. Count and print the number of (contiguous) subarrays where the product of all
阅读全文
摘要:Problem Description: Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of
阅读全文
摘要:Problem Description: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. 给定一个整数n,生成所有不同的二叉搜索树,
阅读全文
摘要:面向对象思想用在大型软件中有很多局限性,设计模式有助于帮助更好地设计。在面试中,设计模式和面向对象的思想一样,很少会有具体的题目,甚至有时候面试官都不会提设计模式,隐形地让面试者优化代码,考察面试者对设计模式对理解。 本文主要记录了四部分:设计模式简介,再谈singleton,变继承关系为组合关系,
阅读全文
摘要:Problem Description: Implement a MyCalendarTwo class to store your events. A new event can be added if adding the event will not cause a triple bookin
阅读全文
摘要:Problem description: Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking.
阅读全文
摘要:Problem Description: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest
阅读全文
摘要:Problem Description: Given an array A of integers, we must modify the array in the following way: we choose an i and replace A[i] with -A[i], and we r
阅读全文
摘要:Problem We consider a number to be beautiful if it consists only of the digit 1 repeated one or more times. Not all numbers are beautiful, but we can
阅读全文
摘要:Problem Description: Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subset
阅读全文
摘要:Problem Description: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to
阅读全文
摘要:Problem Descriptino: On a N x N grid of cells, each cell (x, y)with 0 <= x < N and 0 <= y < N has a lamp. Initially, some number of lamps are on. lamp
阅读全文

浙公网安备 33010602011771号