代码改变世界

[LeetCode] 66. Plus One_Easy tag: array

2021-08-08 08:56 by Johnson_强生仔仔, 22 阅读, 0 推荐, 收藏, 编辑
摘要:Given a non-empty array of decimal digits representing a non-negative integer, increment one to the integer. The digits are stored such that the most 阅读全文

[LeetCode] 48. Rotate Image_Medium tag: array

2021-08-08 04:24 by Johnson_强生仔仔, 8 阅读, 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 阅读全文

[LeetCode] 43. Multiply Strings_Medium tag: string

2021-08-08 00:02 by Johnson_强生仔仔, 24 阅读, 0 推荐, 收藏, 编辑
摘要:Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You mus 阅读全文

[LeetCode] 31. Next Permutation_Medium tag: sort, two pointers

2021-08-07 23:37 by Johnson_强生仔仔, 19 阅读, 0 推荐, 收藏, 编辑
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such an arrangement is not pos 阅读全文

[LeetCode] 11. Container With Most Water_Medium tag: two pointers

2021-08-05 01:33 by Johnson_强生仔仔, 13 阅读, 0 推荐, 收藏, 编辑
摘要:Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp 阅读全文

[LeetCode] 3. Longest Substring Without Repeating Characters_Medium tag: two pointers

2021-08-05 01:24 by Johnson_强生仔仔, 18 阅读, 0 推荐, 收藏, 编辑
摘要:Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The a 阅读全文

[LeetCode] 975. Odd Even Jump_Hard tag: stack, dynamic programming

2021-08-04 10:52 by Johnson_强生仔仔, 41 阅读, 0 推荐, 收藏, 编辑
摘要:You are given an integer array arr. From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called  阅读全文

[LeetCode] 904. Fruit Into Baskets_Medium tag: Two pointers

2021-08-04 10:36 by Johnson_强生仔仔, 41 阅读, 0 推荐, 收藏, 编辑
摘要:You are visiting a farm that has a single row of fruit trees arranged from left to right. The trees are represented by an integer array fruits where f 阅读全文

[LeetCode] 482. License Key Formatting_Easy tag: String

2021-08-04 10:29 by Johnson_强生仔仔, 24 阅读, 0 推荐, 收藏, 编辑
摘要:You are given a license key represented as a string s that consists of only alphanumeric characters and dashes. The string is separated into n + 1 gro 阅读全文

[LeetCode] 929. Unique Email Addresses_Easy tag: Hash

2021-08-03 06:42 by Johnson_强生仔仔, 23 阅读, 0 推荐, 收藏, 编辑
摘要:Every valid email consists of a local name and a domain name, separated by the '@' sign. Besides lowercase letters, the email may contain one or more  阅读全文
上一页 1 2 3 4 5 6 7 8 ··· 39 下一页