摘要:
工厂模式 工厂模式(Factory Pattern)是 Java 中最常用的设计模式之一。这种类型的设计模式属于创建型模式,它提供了一种创建对象的最佳方式。 在工厂模式中,我们在创建对象时不会对客户端暴露创建逻辑,并且是通过使用一个共同的接口来指向新创建的对象。 介绍 意图:定义一个创建对象的接口, 阅读全文
摘要:
DescriptionHintsSubmissionsDiscussSolution Pick One Given two non-negative integers num1 and num2 represented as strings, return the product of num1 a 阅读全文
摘要:
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath betwee 阅读全文
摘要:
Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique q 阅读全文
摘要:
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le 阅读全文
摘要:
Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the thr 阅读全文
摘要:
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文
摘要:
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
摘要:
Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-white 阅读全文
摘要:
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1, 2, 3 ], [ 4, 5, 6 ], 阅读全文