Provide Best Programming Tutorials

## [LeetCode]122. Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many…

## [LeetCode] 3. Longest Substring Without Repeating

Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input:…

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it…

## 1. Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may…

## Using LinearLayout to build Wechat Login interface

Below is how it looks like Here we use LinearLayout to arrange the elements <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/hint_username" android:paddingBottom="20dp"…

## Android Layout Management

Android support 6 types layout which are： RelativeLayoutLinearLayoutFrameLayoutTableLayoutGridLayout

## ssh-copy-id

Log in as root Edit ssh config: sudo nano /etc/ssh/sshd_config Change this line: PasswordAuthentication no to PasswordAuthentication yes Restart daemon: sudo systemctl restart sshd Do ssh-copy-id: ssh-copy-id someuser@<my-ip>    …

## 113. Path Sum II

Question Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. Note: A leaf is a node with no children. Example:…

## 257. Binary Tree Paths

Question Given a binary tree, return all root-to-leaf paths. Note: A leaf is a node with no children. Example: Input: 1 / \ 2 3 \ 5 Output: ["1->2->5", "1->3"] Explanation:…

## 114. Flatten Binary Tree to Linked List

Question Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / \ \ 3 4 6 The…