摘要: Word Pattern Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection betwee 阅读全文
posted @ 2022-10-25 18:35 iyiluo 阅读(22) 评论(0) 推荐(0)
摘要: Add Digits Given an integer num, repeatedly add all its digits until the result has only one digit, and return it. Example 1: Input: num = 38 Output: 阅读全文
posted @ 2022-10-25 18:34 iyiluo 阅读(13) 评论(0) 推荐(0)
摘要: somorphic Strings Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replac 阅读全文
posted @ 2022-10-25 18:33 iyiluo 阅读(21) 评论(0) 推荐(0)
摘要: Reverse String II Given a string s and an integer k, reverse the first k characters for every 2k characters counting from the start of the string. If 阅读全文
posted @ 2022-10-24 17:53 iyiluo 阅读(20) 评论(0) 推荐(0)
摘要: Base 7 Given an integer num, return a string of its base 7 representation. Example 1: Input: num = 100 Output: "202" Example 2: Input: num = -7 Output 阅读全文
posted @ 2022-10-24 17:53 iyiluo 阅读(11) 评论(0) 推荐(0)
摘要: Fibonacci Number The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the 阅读全文
posted @ 2022-10-24 17:53 iyiluo 阅读(20) 评论(0) 推荐(0)
摘要: Ransom Note Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false other 阅读全文
posted @ 2022-10-24 17:52 iyiluo 阅读(17) 评论(0) 推荐(0)
摘要: Sum of Left Leaves Given the root of a binary tree, return the sum of all left leaves. A leaf is a node with no children. A left leaf is a leaf that i 阅读全文
posted @ 2022-10-23 22:37 iyiluo 阅读(10) 评论(0) 推荐(0)
摘要: Assign Cookies Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each 阅读全文
posted @ 2022-10-23 22:18 iyiluo 阅读(15) 评论(0) 推荐(0)
摘要: Fizz Buzz Given an integer n, return a string array answer (1-indexed) where: answer[i] == "FizzBuzz" if i is divisible by 3 and 5. answer[i] == "Fizz 阅读全文
posted @ 2022-10-23 21:41 iyiluo 阅读(14) 评论(0) 推荐(0)