Numpy, pandas, scikit
Matplotlib
- Scatter graph is used to represent the relationship between variables
- 折线图体现变化, 散点图体现x和y的关系,条形图统计离散数据,直方图统计连续数据
1 | import random |
x, y and grid
1 | from matplotlib import pyplot as plt |
1 | import random |
1 | from matplotlib import pyplot as plt |
1 | l = 4 |
Print traiangle
1 | row = int(input('Type a number')) |
Print upside-down triangle
1 | l = 4 |
Diamond
1 | row = int(input('Type a number')) |
1 | import random |
正序乘法表
1 | i = 1 |
逆序乘法表
1 | i = 9 |
triangle
1 | row = 1 |
1 | ''' |
1 | i = 1 |
1 | def greet_user(username): |
1 | import java.util.*; |
Java doesn’t care return value(public static double…) (public static int…)
As long as parameter list not equal, that is overload
1 | import java.util.*; |
Time complexity O(n^2)
HashMap Time complexity O(n)
1 | import java.util.*; |
1 | class Solution |
Given an array of non-negative integers nums
, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the last index.
1 | public boolean canJump(int[] nums) { |
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
Example 1:
Input: nums = [-2,1,-3,4,-1,2,1,-5,4]
Output: 6
Explanation: [4,-1,2,1] has the largest sum = 6.
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.