// 给定2个句子,判断组成a句子的字母和b句子是否完全一样; 不包括表单符号和大小写; // 输入数据 var strA = "The quick brown fox jumps over the lazy dog."; var strB = "Waltz, bad nymph, for quick jigs vex."; // Sphinx of black quartz, judge my vow // How vexingly quick daft zebras jump // Pack my box with five dozen liquor jugs // Jackdaws love my big sphinx of quartz // This sentence will not work with the function. // 需要的输出结果: isSameChars(strA, strB); // true 请认真读题 解答思路是
// 给定2个句子,判断组成a句子的字母和b句子是否完全一样; 不包括表单符号和大小写; // 输入数据 var strA = "The quick brown fox jumps over the lazy dog."; var strB = "Waltz, bad nymph, for quick jigs vex."; // Sphinx of black quartz, judge my vow // How vexingly quick daft zebras jump // Pack my box with five dozen liquor jugs // Jackdaws love my big sphinx of quartz // This sentence will not work with the function. // 需要的输出结果: isSameChars(strA, strB); // true 请认真读题 解答思路是
// 给定2个句子,判断组成a句子的字母和b句子是否完全一样; 不包括表单符号和大小写;
// 输入数据
var strA = "The quick brown fox jumps over the lazy dog.";
var strB = "Waltz, bad nymph, for quick jigs vex.";
// Sphinx of black quartz, judge my vow
// How vexingly quick daft zebras jump
// Pack my box with five dozen liquor jugs
// Jackdaws love my big sphinx of quartz
// This sentence will not work with the function.
// 需要的输出结果:
isSameChars(strA, strB); // true
请认真读题 解答思路是
用户383020657
2024年03月05日
|
浏览 291
抱歉,我无法执行代码或逻辑判断。如果给定2个句子,要判断这两个句子组成的字母是否完全一样,可以按照以下思路进行:
- 首先将两个句子中的字母都转换为小写字母,以便进行比较。
- 去除句子中的空格和标点符号,只保留字母部分。
- 将两个句子中的字母分别存储为数组或字符串。
- 对这两个数组或字符串进行排序。
- 最后比较两个排序后的数组或字符串是否相等,如果相等则说明这两个句子组成的字母完全一样。
根据您提供的例子,调用 isSameChars(strA, strB) 应该返回 true。
我要提问
复制内容
分享给好友
AI编程问答网 免责声明:
以上内容除特别注明外均来源于网友提问,AI编程问答网回答,权益归原著者所有;
下一篇:python中如何把数字变成字母
