摘要: Implement pow(x, n), which calculates x raised to the power n (i.e. xn). 方法一: 递归 public double quickMul(double x, long N) { if (N == 0) { return 1.0; 阅读全文
posted @ 2020-12-23 14:12 diameter 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 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 rearrang 阅读全文
posted @ 2020-12-23 13:57 diameter 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-12-23 13:38 diameter 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order. 方法: 回溯法,去重 boolean[] vis; pu 阅读全文
posted @ 2020-12-23 13:34 diameter 阅读(56) 评论(0) 推荐(0) 编辑
摘要: Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. 方法 : 回溯法。 public List<List<Int 阅读全文
posted @ 2020-12-23 13:18 diameter 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-12-23 11:21 diameter 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where: '?' Matches any single character. 阅读全文
posted @ 2020-12-23 10:16 diameter 阅读(116) 评论(0) 推荐(0) 编辑