【LeetCode】To Lower Case(转换成小写字母) 这道题是LeetCode里的第709道题。 题目要求: 实现函数 ToLowerCase(),该函数接收一个字符串参数 str,并将该字符串中的大写字母转换成小写字母,之后返回新的字符串。 示例 1: 示例 2: 示例 3: 这么简单的题,还要啥解析啊! 解题代码: 提交结果: 个人总结: 这...
To Lower Case 709. To Lower Case Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Example 2: Example 3: 题目描述:实现一个 ToLowerCase 函数,函数功能是将字符串中的大写字母...leetcode 709. To Lower Case Implement ...
709. To Lower Case(Easy) Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Input: "Hello" Output: "hello" Example 2: Input: "here" Output: "here" Example 3: Input: "LOVELY" Output: "lovely" Note: there are many...
*/vartoLowerCase =function(str) {returnstr.toLowerCase() }; ↑↑↑这是 JavaScript 的懒人解法。↑↑↑ #@param{String} str#@return{String}defto_lower_case(str)down ="abcdefghijklmnopqrstuvwxyz"up ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"result =""str.each_chardo|char|ifup.include?(char) char = dow...
709. To Lower CaseImplement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.Example 1:Input: "Hello" Output: "hello" Example 2:Input: "here" Output: "here" Example 3:Input: "LOVELY" Output: "lovely" 题目描述:实现一个 ToLowerCase 函数,...
To Lower Case(转换成小写字母) * 实现函数 ToLowerCase(),该函数接收一个字符串参数 str,并将该字符串中的大写字母转换成小写字母,之后返回新的字符串。 */ public class Solution709 { public static void main(String[] args) { Solution709 solution709 = new Solution709(); String str = "Hello"; ...
LeetCode-To Lower Case Description: Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Input: "Hello" Output: "hello" 1. 2. Example 2: Input: "here" Output: "here"...
代码语言:javascript 代码 classSolution{publicStringtoLowerCase(String str){char[]chars=str.toCharArray();for(int i=0;i<chars.length;i++){char c=chars[i]90chars[i]=(c+=32);}}returnnewString(chars);}}
right) { if (Character.toLowerCase(s.charAt(left)) != Character.toLowerCase(s.charAt(right))) { return false; } ++left; --right; } } return true; }} 复杂度分析 时间复杂度:$O(N)$空间复杂度:$O(1)$ ...
Description Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Input: "Hello" Output: "hello" 1. 2. Example 2: Input: "here" Output: "here" 1. 2. Example 3: ...