11 2020 档案
摘要:Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Input:
阅读全文
摘要:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, 2 is written as II in Roman numeral, just two one's ad
阅读全文
摘要:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, 2 is written as II in Roman numeral, just two one's ad
阅读全文
摘要: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
阅读全文
摘要:Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'where: '.' Matches any single character
阅读全文
摘要:Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Follow up: Could you solve it wit
阅读全文
摘要:Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-white
阅读全文
摘要:Given a 32-bit signed integer, reverse digits of an integer. Note:Assume we are dealing with an environment that could only store integers within the
阅读全文
摘要:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font
阅读全文
摘要:一、如果按字节处理,可以用struct https://docs.python.org/2/library/struct.html By default, C types are represented in the machine’s native format and byte order, a
阅读全文
摘要:Given a string s, return the longest palindromic substring in s. Input: s = "babad"Output: "bab"Note: "aba" is also a valid answer. 方法一: 暴力法,双层循环,验证所以
阅读全文
摘要:Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity shou
阅读全文
摘要:Given a string s, find the length of the longest substring without repeating characters. Input: s = "abcabcbb"Output: 3Explanation: The answer is "abc
阅读全文
摘要: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 conta
阅读全文
摘要:Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each inp
阅读全文