- 博客(5)
- 收藏
- 关注
原创 练习题 将字符串中出现大于1次的字符转为’)' 否则为'('
原题:The goal of this exercise is to convert a string to a new string where each character in the new string is '(' if that character appears only once in the original string, or ')' if that character a...
2018-06-02 16:28:26 502
原创 练习题 将输入的秒数转换为时间格式
原题Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (HH:MM:SS)HH = hours, padded to 2 digits, range: 00 - 99MM = minutes, padded t...
2018-06-02 15:41:44 1425
原创 练习题 按照字符串中数字的顺序重组字符串
题目:Your task is to sort a given string.Each word in the String will contain a single number. This number is the position the word should have in the result.Note: Numbers can be from 1 to 9. So 1 will ...
2018-06-02 15:10:29 565
原创 练习题:字符串索引为偶数的变大写字母,返回字符串
原题:Write a function that accepts a string, and returns the same string with all even indexed characters in each word upper cased, and all odd indexed characters in each word lower cased. The indexing...
2018-06-02 14:09:21 1175
原创 两数之和
题目:给定一个整数数组和一个目标值,找出数组中和为目标值的两个数。你可以假设每个输入只对应一种答案,且同样的元素不能被重复利用。示例:给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9所以返回 [0, 1]我的解答:Python31class Solution:2 def twoSum(self, ...
2018-05-12 16:51:41 270
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人