記錄: 2016

0

Roman to Integer

Roman to IntegerGiven a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 提示 解題應用 Math 規律觀察 String 規律觀察 Default:12func romanToInt(s strin

0

Palindrome Number

Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer

0

Reverse Integer

Reverse IntegerReverse digits of an integer. Exmaple1:1x = 123, return 321 Exmaple2:1x = -123, return -321 Have you thought about this? Here are some good questions to ask before coding. Bonus points

0

ZigZag Conversion

ZigZag ConversionThe 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 for better legibility) Exmaple:1

0

Two Sum

Two SumGiven 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. Exmaple:1234Given nums