Just verify code of others.
Java
1 | class Solution { |
binary (introduced in Java SE 7) 0b11110101 (0b followed by a binary number)
Submission Detail
- 49 / 49 test cases passed.
- Runtime: 6 ms
- Your runtime beats 27.65 % of java submissions.
Just verify code of others.
1 | class Solution { |
binary (introduced in Java SE 7) 0b11110101 (0b followed by a binary number)
It seemed that Spotify only let you click big green SHUFFLE PLAY button if you are not premium user.
1 | import java.util.Random; |
© Robert Sedgewick and Kevin Wayne
Proposition. [Fisher-Yates 1938] Knuth shuffling algorithm produces a uniformly random permutation of the input array in linear time.
1 | class Solution { |
1 | import java.util.Arrays; |
In Java collections framework, HashMap is the class I used most. Hash function is a hard problem.
1 | class MyHashMap { |
Tagged as easy, I feel it is not easy to solve. dynamic programming class problem. The solution is others, I only verify it.
1 | class Solution { |
1 | class Solution { |
1 | class Solution { |
1 | class Solution { |
1 | class Solution { |
Tag easy as it is. This problem is like 387. First Unique Character in a String.
1 | class Solution { |
1 | /** |
Manindra Agrawal & Neeraj Kayal & Nitin Saxena present an unconditional deterministic polynomial-time algorithm that determines whether an input number is prime or composite.
The AKS algorithm for testing whether a number is prime is a polynomial-time algorithm based on an elementary theorem about Pascal triangles.
1 | use std::iter::repeat; |
An alternative version which computes the coefficients in a more functional but less efficient way.
1 | fn aks_coefficients(k: usize) -> Vec<i64> { |
1 | public class AksTest { |
1 | function coef(n) { |
1 | var i, p, pascal, primerow, primes, show, _i; |
1 | function pascal(n) { |
前端工程化(工具)
前端组件化(生态)
1 | { |
1 | var chunks = Object.keys(entries); |
ECMAScript 6, ECMAScript 2015
Spring Portfolio 包括多个构建于核心Spring 框架之上的框架和类库。概括地说,整个Spring Portfolio 几乎为每一个领域的Java 开发都提供了Spring 编程模型。
From configuration to security, web apps to big data – whatever the infrastructure needs of your application may be, there is a Spring Project to help you build it. Start small and use just what you need – Spring is modular by design.
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run”.
Spring Boot 大量依赖于自动配置技术,它能消除大部分 Spring 配置。它还提供了多个 Starter 项目,不管你使用 Maven 还是 Gradle,这都能减少 Spring 工程构建文件的大小。
Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns. They will work well in any distributed environment, including the developer’s own laptop, bare metal data centres, and managed platforms such as Cloud Foundry.
Spring Data’s mission is to provide a familiar and consistent, Spring-based programming model for data access while still retaining the special traits of the underlying data store.
It makes it easy to use data access technologies, relational and non-relational databases, map-reduce frameworks, and cloud-based data services. This is an umbrella project which contains many subprojects that are specific to a given database. The projects are developed by working together with many of the companies and developers that are behind these exciting technologies.
不管你使用文档数据库,如 MongoDB;图数据库,如 Neo4j;还是传统的关系型数据库,Spring Data 都为持久化提供了一种简单的编程模型。这包括为多种数据库类型提供了一种自动化的 Repository 机制,它负责为你创建 Repository 的实现。
Spring Security is a powerful and highly customizable authentication and access-control framework. It is the de-facto standard for securing Spring-based applications.
Spring Security is a framework that focuses on providing both authentication and authorization to Java applications. Like all Spring projects, the real power of Spring Security is found in how easily it can be extended to meet custom requirements
为 Spring 应用提供了声明式的安全机制。
Extends the Spring programming model to support the well-known Enterprise Integration Patterns. Spring Integration enables lightweight messaging within Spring-based applications and supports integration with external systems via declarative adapters. Those adapters provide a higher-level of abstraction over Spring’s support for remoting, messaging, and scheduling. Spring Integration’s primary goal is to provide a simple model for building enterprise integration solutions while maintaining the separation of concerns that is essential for producing maintainable, testable code.
提供了多种通用应用集成模式的 Spring 声明式风格实现。
The Spring for Apache Kafka (spring-kafka) project applies core Spring concepts to the development of Kafka-based messaging solutions. It provides a “template” as a high-level abstraction for sending messages. It also provides support for Message-driven POJOs with @KafkaListener annotations and a “listener container”. These libraries promote the use of dependency injection and declarative. In all of these cases, you will see similarities to the JMS support in the Spring Framework and RabbitMQ support in Spring AMQP.
The Spring AMQP project applies core Spring concepts to the development of AMQP-based messaging solutions. It provides a “template” as a high-level abstraction for sending and receiving messages. It also provides support for Message-driven POJOs with a “listener container”. These libraries facilitate management of AMQP resources while promoting the use of dependency injection and declarative configuration. In all of these cases, you will see similarities to the JMS support in the Spring Framework.
The project consists of two parts; spring-amqp is the base abstraction, and spring-rabbit is the RabbitMQ implementation.
Spring Web Services (Spring-WS) is a product of the Spring community focused on creating document-driven Web services. Spring Web Services aims to facilitate contract-first SOAP service development, allowing for the creation of flexible web services using one of the many ways to manipulate XML payloads. The product is based on Spring itself, which means you can use the Spring concepts such as dependency injection as an integral part of your Web service.
提供了契约优先的 Web Service 模型,服务的实现都是为了满足服务的契约而编写的。
Spring HATEOAS provides some APIs to ease creating REST representations that follow the HATEOAS principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly.
Spring REST Docs helps you to document RESTful services.
It combines hand-written documentation written with Asciidoctor and auto-generated snippets produced with Spring MVC Test. This approach frees you from the limitations of the documentation produced by tools like Swagger.
It helps you to produce documentation that is accurate, concise, and well-structured. This documentation then allows your users to get the information they need with a minimum of fuss.
A lightweight, comprehensive batch framework designed to enable the development of robust batch applications vital for the daily operations of enterprise systems.
Spring Batch provides reusable functions that are essential in processing large volumes of records, including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource management. It also provides more advanced technical services and features that will enable extremely high-volume and high performance batch jobs through optimization and partitioning techniques. Simple as well as complex, high-volume batch jobs can leverage the framework in a highly scalable manner to process significant volumes of information.
如果需要开发一个批处理应用,可以通过 Spring Batch,使用 Spring 强大的面向 POJO 的编程模型。
Spring Web Flow builds on Spring MVC and allows implementing the “flows” of a web application. A flow encapsulates a sequence of steps that guide a user through the execution of some business task. It spans multiple HTTP requests, has state, deals with transactional data, is reusable, and may be dynamic and long-running in nature..
建立于 Spring MVC 框架之上,它为基于流程的会话式 Web 应用提供支持。
Spring Cloud Data Flow is a toolkit for building data integration and real-time data processing pipelines.
Pipelines consist of Spring Boot apps, built using the Spring Cloud Stream or Spring Cloud Task microservice frameworks. This makes Spring Cloud Data Flow suitable for a range of data processing use cases, from import/export to event streaming and predictive analytics.
Spring Session provides an API and implementations for managing a user’s session information.
The solution of wikipedia is the elegant answer to this question. It finally passed on LeetCode after I modified and submited six times.
Sometimes we already have a binary tree, and we need to determine whether it is a BST. This problem has a simple recursive solution.
Essentially we keep creating a valid range (starting from [MIN_VALUE, MAX_VALUE]) and keep shrinking it down for each node as we go down recursively.
Given a binary tree, determine if it is a valid binary search tree (BST).
1 | /** |